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

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


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Aug 25 09:45:20 2017 +0200| [13f9639e3e2af50017c48fd804d76bad455f61af] | committer: Paul B Mahol

avfilter/af_headphone: 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=13f9639e3e2af50017c48fd804d76bad455f61af
---

 libavfilter/af_headphone.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index 4fd6191bc4..f6edccc9bd 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -660,7 +660,7 @@ static int config_input(AVFilterLink *inlink)
 static av_cold int init(AVFilterContext *ctx)
 {
     HeadphoneContext *s = ctx->priv;
-    int i;
+    int i, ret;
 
     AVFilterPad pad = {
         .name         = "in0",
@@ -668,7 +668,8 @@ static av_cold int init(AVFilterContext *ctx)
         .config_props = config_input,
         .filter_frame = filter_frame,
     };
-    ff_insert_inpad(ctx, 0, &pad);
+    if ((ret = ff_insert_inpad(ctx, 0, &pad)) < 0)
+        return ret;
 
     if (!s->map) {
         av_log(ctx, AV_LOG_ERROR, "Valid mapping must be set.\n");
@@ -690,7 +691,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;
+        }
     }
 
     s->fdsp = avpriv_float_dsp_alloc(0);



More information about the ffmpeg-cvslog mailing list