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

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


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

lavf/qsv_vpp: 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=f7d77b4112f70a15552fbce2ce3d10a4186571b1
---

 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 eb2f1cc7eb..bd5fc32299 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;
 }



More information about the ffmpeg-cvslog mailing list