[FFmpeg-devel] [PATCH] vf_hwupload: Add missing return value checks

Jun Zhao mypopydev at gmail.com
Mon Feb 27 04:18:43 EET 2017


From e60a958c78ba084e0745acebec5125394387c5b1 Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao at intel.com>
Date: Mon, 27 Feb 2017 10:08:36 +0800
Subject: [PATCH] vf_hwupload: Add missing return value checks

Add missing return value checks to fix the build warning.

Signed-off-by: Jun Zhao <jun.zhao at intel.com>
---
 libavfilter/vf_hwupload.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
index 08af2dd..ce39307 100644
--- a/libavfilter/vf_hwupload.c
+++ b/libavfilter/vf_hwupload.c
@@ -81,10 +81,12 @@ static int hwupload_query_formats(AVFilterContext *avctx)
         }
     }
 
-    ff_formats_ref(input_formats, &avctx->inputs[0]->out_formats);
-
-    ff_formats_ref(ff_make_format_list(output_pix_fmts),
-                   &avctx->outputs[0]->in_formats);
+    if ((err = ff_formats_ref(input_formats, &avctx->inputs[0]->out_formats)) < 0 ||
+        (err = ff_formats_ref(ff_make_format_list(output_pix_fmts),
+                              &avctx->outputs[0]->in_formats)) < 0) {
+        ff_formats_unref(&input_formats);
+        goto fail;
+    }
 
     av_hwframe_constraints_free(&constraints);
     return 0;
-- 
2.9.3



More information about the ffmpeg-devel mailing list