[FFmpeg-cvslog] avfilter/af_amix: check ff_insert_inpad() for failure

Paul B Mahol git at videolan.org
Fri Aug 25 11:34:31 EEST 2017


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Aug 25 09:36:22 2017 +0200| [1e7ce6d92513f0bf0037a0b7ebb96ffc7c0c7993] | committer: Paul B Mahol

avfilter/af_amix: check ff_insert_inpad() for failure

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

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



More information about the ffmpeg-cvslog mailing list