From 1e7ce6d92513f0bf0037a0b7ebb96ffc7c0c7993 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 25 Aug 2017 09:36:22 +0200 Subject: [PATCH] avfilter/af_amix: check ff_insert_inpad() for failure --- libavfilter/af_amix.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c index 809c8bf9ca..78be57ac3f 100644 --- a/libavfilter/af_amix.c +++ b/libavfilter/af_amix.c @@ -483,7 +483,7 @@ fail: static av_cold int init(AVFilterContext *ctx) { MixContext *s = ctx->priv; - int i; + int i, ret; for (i = 0; i < s->nb_inputs; i++) { char name[32]; @@ -496,7 +496,10 @@ static av_cold int init(AVFilterContext *ctx) return AVERROR(ENOMEM); pad.filter_frame = filter_frame; - ff_insert_inpad(ctx, i, &pad); + if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) { + av_freep(&pad.name); + return ret; + } } s->fdsp = avpriv_float_dsp_alloc(0);