From 448c88e1a586adc350e5a07c18c0be6706101deb Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 8 Aug 2017 22:42:21 +0000 Subject: [PATCH] avfilter/dynaudnorm: increment input outside of the FFMIN macro so it doesn't get double incremented --- libavfilter/af_dynaudnorm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_dynaudnorm.c b/libavfilter/af_dynaudnorm.c index d4ebd96590..5919304267 100644 --- a/libavfilter/af_dynaudnorm.c +++ b/libavfilter/af_dynaudnorm.c @@ -460,7 +460,8 @@ static void update_gain_history(DynamicAudioNormalizerContext *s, int channel, int input = pre_fill_size; while (cqueue_size(s->gain_history_minimum[channel]) < pre_fill_size) { - initial_value = FFMIN(initial_value, cqueue_peek(s->gain_history_original[channel], ++input)); + input++; + initial_value = FFMIN(initial_value, cqueue_peek(s->gain_history_original[channel], input)); cqueue_enqueue(s->gain_history_minimum[channel], initial_value); } }