[FFmpeg-devel] [PATCH] vf_scale_vaapi: Add missing return value checks
Mark Thompson
sw at jkqxz.net
Mon Jan 9 02:59:50 EET 2017
---
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 --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;
}
--
2.11.0
More information about the ffmpeg-devel
mailing list