From d0e740b8fb30f02914594d00eb311a32442a63f8 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 30 May 2018 12:30:24 +0200 Subject: [PATCH] avfilter/af_afir: fix picking of IR channel Signed-off-by: Paul B Mahol --- libavfilter/af_afir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/af_afir.c b/libavfilter/af_afir.c index cdc7d29e7e..75de14729d 100644 --- a/libavfilter/af_afir.c +++ b/libavfilter/af_afir.c @@ -230,7 +230,7 @@ static void draw_response(AVFilterContext *ctx, AVFrame *out) if (!mag || !phase) goto end; - channel = av_clip(s->ir_channel, 0, s->in[1]->channels); + channel = av_clip(s->ir_channel, 0, s->in[1]->channels - 1); for (i = 0; i < s->w; i++) { const float *src = (const float *)s->in[1]->extended_data[channel]; double w = i * M_PI / (s->w - 1);