diff mbox

[FFmpeg-devel] vf_scale_vaapi: Add missing return value checks

Message ID 0314f93a-477b-a20d-9917-fce24c67f357@jkqxz.net
State Accepted
Commit 326b1ed93e25f2b2d505ee88325fabb190d8c275
Headers show

Commit Message

Mark Thompson Jan. 9, 2017, 12:59 a.m. UTC
---
CC      libavfilter/vf_scale_vaapi.o
src/libavfilter/vf_scale_vaapi.c: In function ‘scale_vaapi_query_formats’:
src/libavfilter/vf_scale_vaapi.c:65:5: warning: ignoring return value of ‘ff_formats_ref’, declared with attribute warn_unused_result [-Wunused-result]
     ff_formats_ref(ff_make_format_list(pix_fmts),
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    &avctx->inputs[0]->out_formats);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/libavfilter/vf_scale_vaapi.c:67:5: warning: ignoring return value of ‘ff_formats_ref’, declared with attribute warn_unused_result [-Wunused-result]
     ff_formats_ref(ff_make_format_list(pix_fmts),
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    &avctx->outputs[0]->in_formats);
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(Inspired by noting the same issue on vf_deinterlace_vaapi.c.)


 libavfilter/vf_scale_vaapi.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index d1cb246d1f..612d001c42 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -61,11 +61,14 @@  static int scale_vaapi_query_formats(AVFilterContext *avctx)
     enum AVPixelFormat pix_fmts[] = {
         AV_PIX_FMT_VAAPI, AV_PIX_FMT_NONE,
     };
+    int err;
 
-    ff_formats_ref(ff_make_format_list(pix_fmts),
-                   &avctx->inputs[0]->out_formats);
-    ff_formats_ref(ff_make_format_list(pix_fmts),
-                   &avctx->outputs[0]->in_formats);
+    if ((err = ff_formats_ref(ff_make_format_list(pix_fmts),
+                              &avctx->inputs[0]->out_formats)) < 0)
+        return err;
+    if ((err = ff_formats_ref(ff_make_format_list(pix_fmts),
+                              &avctx->outputs[0]->in_formats)) < 0)
+        return err;
 
     return 0;
 }