avfilter/af_anequalizer: fix off by one in reallocation

pull/336/head
Paul B Mahol 5 years ago
parent fa5bff611d
commit 6fbc7f092e
  1. 2
      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));

Loading…
Cancel
Save