avfilter/af_afade: fix heap-buffer overflow

Fixes #8276
This commit is contained in:
Paul B Mahol 2019-10-15 16:55:13 +02:00
parent de598f82f8
commit e1b89c76f6
1 changed files with 2 additions and 1 deletions

View 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)