[FFmpeg-cvslog] lavf/qsv_overlay: check the return value of ff_formats_ref()

Zhong Li git at videolan.org
Mon Nov 20 17:56:10 EET 2017


ffmpeg | branch: master | Zhong Li <zhong.li at intel.com> | Mon Nov 20 04:14:33 2017 -0500| [81c615f0feb2a871b75c7fa6d895e7e92a570f7c] | committer: Mark Thompson

lavf/qsv_overlay: check the return value of ff_formats_ref()

Fixes 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>
Signed-off-by: Mark Thompson <sw at jkqxz.net>

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

 libavfilter/vf_overlay_qsv.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_overlay_qsv.c b/libavfilter/vf_overlay_qsv.c
index 1f50d4bb21..6c3efdbeb5 100644
--- a/libavfilter/vf_overlay_qsv.c
+++ b/libavfilter/vf_overlay_qsv.c
@@ -415,6 +415,7 @@ static void overlay_qsv_uninit(AVFilterContext *ctx)
 static int overlay_qsv_query_formats(AVFilterContext *ctx)
 {
     int i;
+    int ret;
 
     static const enum AVPixelFormat main_in_fmts[] = {
         AV_PIX_FMT_YUV420P,
@@ -430,10 +431,15 @@ static int overlay_qsv_query_formats(AVFilterContext *ctx)
         AV_PIX_FMT_NONE
     };
 
-    for (i = 0; i < ctx->nb_inputs; i++)
-        ff_formats_ref(ff_make_format_list(main_in_fmts), &ctx->inputs[i]->out_formats);
+    for (i = 0; i < ctx->nb_inputs; i++) {
+        ret = ff_formats_ref(ff_make_format_list(main_in_fmts), &ctx->inputs[i]->out_formats);
+        if (ret < 0)
+            return ret;
+    }
 
-    ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats);
+    ret = ff_formats_ref(ff_make_format_list(out_pix_fmts), &ctx->outputs[0]->in_formats);
+    if (ret < 0)
+        return ret;
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list