From f7d77b4112f70a15552fbce2ce3d10a4186571b1 Mon Sep 17 00:00:00 2001 From: Zhong Li Date: Mon, 20 Nov 2017 04:14:34 -0500 Subject: [PATCH] lavf/qsv_vpp: check the return value of ff_formats_ref() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the build warning of "ignoring return value of ‘ff_formats_ref’, declared with attribute warn_unused_result" Signed-off-by: Zhong Li Reviewed-by: Carl Eugen Hoyos Signed-off-by: Mark Thompson --- 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; }