avfilter/af_anequalizer: fix off by one in reallocation
authorPaul B Mahol <onemda@gmail.com>
Sat, 14 Mar 2020 18:39:04 +0000 (19:39 +0100)
committerPaul B Mahol <onemda@gmail.com>
Sat, 14 Mar 2020 18:39:04 +0000 (19:39 +0100)
libavfilter/af_anequalizer.c

index c974fd5..177e1c7 100644 (file)
@@ -566,7 +566,7 @@ static void equalizer(EqualizatorFilter *f, double sample_rate)
 static int add_filter(AudioNEqualizerContext *s, AVFilterLink *inlink)
 {
     equalizer(&s->filters[s->nb_filters], inlink->sample_rate);
-    if (s->nb_filters >= s->nb_allocated) {
+    if (s->nb_filters >= s->nb_allocated - 1) {
         EqualizatorFilter *filters;
 
         filters = av_calloc(s->nb_allocated, 2 * sizeof(*s->filters));