avfilter/af_afade: fix heap-buffer overflow
authorPaul B Mahol <onemda@gmail.com>
Tue, 15 Oct 2019 14:55:13 +0000 (16:55 +0200)
committerPaul B Mahol <onemda@gmail.com>
Tue, 15 Oct 2019 14:55:13 +0000 (16:55 +0200)
Fixes #8276

libavfilter/af_afade.c

index 195fb65..0c43b22 100644 (file)
@@ -483,7 +483,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_inlink_queued_samples(ctx->inputs[1]) >= s->nb_samples) {
+    } else if (ff_inlink_queued_samples(ctx->inputs[0]) >= s->nb_samples &&
+               ff_inlink_queued_samples(ctx->inputs[1]) >= s->nb_samples) {
         if (s->overlap) {
             out = ff_get_audio_buffer(outlink, s->nb_samples);
             if (!out)