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

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


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Aug 25 09:50:57 2017 +0200| [f39136b0a76e61d149bf50d287b2110273a8afa1] | committer: Paul B Mahol

avfilter/af_merge: check ff_insert_inpad() for failure

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavfilter/af_amerge.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index cc974cdb7f..09c660ef49 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -322,7 +322,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
 static av_cold int init(AVFilterContext *ctx)
 {
     AMergeContext *s = ctx->priv;
-    int i;
+    int i, ret;
 
     s->in = av_calloc(s->nb_inputs, sizeof(*s->in));
     if (!s->in)
@@ -336,7 +336,10 @@ static av_cold int init(AVFilterContext *ctx)
         };
         if (!name)
             return AVERROR(ENOMEM);
-        ff_insert_inpad(ctx, i, &pad);
+        if ((ret = ff_insert_inpad(ctx, i, &pad)) < 0) {
+            av_freep(&pad.name);
+            return ret;
+        }
     }
     return 0;
 }



More information about the ffmpeg-cvslog mailing list