Browse Source

avfilter/af_astats: clip input value to prevent overflow

tags/n4.4
Paul B Mahol 4 years ago
parent
commit
89c9c42c5b
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavfilter/af_astats.c

+ 1
- 1
libavfilter/af_astats.c View File

@@ -329,7 +329,7 @@ static inline void update_stat(AudioStatsContext *s, ChannelStats *p, double d,

drop = p->win_samples[p->win_pos];
p->win_samples[p->win_pos] = nd;
index = av_clip(FFABS(nd) * HISTOGRAM_MAX, 0, HISTOGRAM_MAX);
index = av_clip(FFABS(av_clipd(nd, -1.0, 1.0)) * HISTOGRAM_MAX, 0, HISTOGRAM_MAX);
p->max_index = FFMAX(p->max_index, index);
p->histogram[index]++;
if (!isnan(p->noise_floor))


Loading…
Cancel
Save