[FFmpeg-cvslog] avfilter/af_afade: fix heap-buffer overflow

Paul B Mahol git at videolan.org
Tue Sep 14 00:16:50 EEST 2021


ffmpeg | branch: release/4.1 | Paul B Mahol <onemda at gmail.com> | Tue Oct 15 16:55:13 2019 +0200| [df5e01770900f11eec0c500ccbaddcc6a9d0963d] | committer: James Almer

avfilter/af_afade: fix heap-buffer overflow

Fixes #8276

(cherry picked from commit e1b89c76f66343d1b495165664647317c66764bb)
Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df5e01770900f11eec0c500ccbaddcc6a9d0963d
---

 libavfilter/af_afade.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c
index 8d9ba916bf..d1135ee16b 100644
--- a/libavfilter/af_afade.c
+++ b/libavfilter/af_afade.c
@@ -484,7 +484,8 @@ static int activate(AVFilterContext *ctx)
         s->pts += av_rescale_q(in->nb_samples,
             (AVRational){ 1, outlink->sample_rate }, outlink->time_base);
         return ff_filter_frame(outlink, in);
-    } else if (ff_framequeue_queued_samples(&ctx->inputs[1]->fifo) >= s->nb_samples) {
+    } else if (ff_framequeue_queued_samples(&ctx->inputs[0]->fifo) >= s->nb_samples &&
+               ff_framequeue_queued_samples(&ctx->inputs[1]->fifo) >= s->nb_samples) {
         if (s->overlap) {
             out = ff_get_audio_buffer(outlink, s->nb_samples);
             if (!out)



More information about the ffmpeg-cvslog mailing list