From 6fbc7f092e7c8d405f3fb38f0b550e12156601c4 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 14 Mar 2020 19:39:04 +0100 Subject: [PATCH] avfilter/af_anequalizer: fix off by one in reallocation --- libavfilter/af_anequalizer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c index c974fd5abc..177e1c7b39 100644 --- a/libavfilter/af_anequalizer.c +++ b/libavfilter/af_anequalizer.c @@ -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));