Commit 6fbc7f09 authored by Paul B Mahol's avatar Paul B Mahol

avfilter/af_anequalizer: fix off by one in reallocation

parent fa5bff61
...@@ -566,7 +566,7 @@ static void equalizer(EqualizatorFilter *f, double sample_rate) ...@@ -566,7 +566,7 @@ static void equalizer(EqualizatorFilter *f, double sample_rate)
static int add_filter(AudioNEqualizerContext *s, AVFilterLink *inlink) static int add_filter(AudioNEqualizerContext *s, AVFilterLink *inlink)
{ {
equalizer(&s->filters[s->nb_filters], inlink->sample_rate); 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; EqualizatorFilter *filters;
filters = av_calloc(s->nb_allocated, 2 * sizeof(*s->filters)); filters = av_calloc(s->nb_allocated, 2 * sizeof(*s->filters));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment