]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/af_afir: fix picking of IR channel
authorPaul B Mahol <onemda@gmail.com>
Wed, 30 May 2018 10:30:24 +0000 (12:30 +0200)
committerPaul B Mahol <onemda@gmail.com>
Wed, 30 May 2018 10:30:24 +0000 (12:30 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/af_afir.c

index cdc7d29e7e28eb65e73bc77d7c8e48f926d60982..75de14729dab3e0f34558dc8c2988244fb566f54 100644 (file)
@@ -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);