[FFmpeg-devel] [PATCH v2 3/3] lavf/qsv_vpp: check the return value of ff_formats_ref()

Zhong Li zhong.li at intel.com
Mon Nov 20 11:14:34 EET 2017


suppress the build warning of "ignoring return value of ‘ff_formats_ref’,
declared with attribute warn_unused_result"

Signed-off-by: Zhong Li <zhong.li at intel.com>
Reviewed-by: Carl Eugen Hoyos <ceffmpeg at gmail.com>
---
 libavfilter/vf_vpp_qsv.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index eb2f1cc..bd5fc32 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -332,6 +332,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
 
 static int query_formats(AVFilterContext *ctx)
 {
+    int ret;
     AVFilterFormats *in_fmts, *out_fmts;
     static const enum AVPixelFormat in_pix_fmts[] = {
         AV_PIX_FMT_YUV420P,
@@ -349,8 +350,12 @@ static int query_formats(AVFilterContext *ctx)
 
     in_fmts  = ff_make_format_list(in_pix_fmts);
     out_fmts = ff_make_format_list(out_pix_fmts);
-    ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats);
-    ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats);
+    ret = ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats);
+    if (ret < 0)
+        return ret;
+    ret = ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats);
+    if (ret < 0)
+        return ret;
 
     return 0;
 }
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list