avfilter/vf_fieldmatch: check ff_insert_inpad() for failure
authorPaul B Mahol <onemda@gmail.com>
Fri, 25 Aug 2017 08:20:13 +0000 (10:20 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 25 Aug 2017 08:20:13 +0000 (10:20 +0200)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/vf_fieldmatch.c

index 1740215..3694f26 100644 (file)
@@ -904,17 +904,24 @@ static av_cold int fieldmatch_init(AVFilterContext *ctx)
         .filter_frame = filter_frame,
         .config_props = config_input,
     };
+    int ret;
 
     if (!pad.name)
         return AVERROR(ENOMEM);
-    ff_insert_inpad(ctx, INPUT_MAIN, &pad);
+    if ((ret = ff_insert_inpad(ctx, INPUT_MAIN, &pad)) < 0) {
+        av_freep(&pad.name);
+        return ret;
+    }
 
     if (fm->ppsrc) {
         pad.name = av_strdup("clean_src");
         pad.config_props = NULL;
         if (!pad.name)
             return AVERROR(ENOMEM);
-        ff_insert_inpad(ctx, INPUT_CLEANSRC, &pad);
+        if ((ret = ff_insert_inpad(ctx, INPUT_CLEANSRC, &pad)) < 0) {
+            av_freep(&pad.name);
+            return ret;
+        }
     }
 
     if ((fm->blockx & (fm->blockx - 1)) ||