Browse code

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@intel.com>
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>

Zhong Li authored on 2017/11/20 18:14:34
Showing 1 changed files
... ...
@@ -332,6 +332,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
332 332
 
333 333
 static int query_formats(AVFilterContext *ctx)
334 334
 {
335
+    int ret;
335 336
     AVFilterFormats *in_fmts, *out_fmts;
336 337
     static const enum AVPixelFormat in_pix_fmts[] = {
337 338
         AV_PIX_FMT_YUV420P,
... ...
@@ -349,8 +350,12 @@ static int query_formats(AVFilterContext *ctx)
349 349
 
350 350
     in_fmts  = ff_make_format_list(in_pix_fmts);
351 351
     out_fmts = ff_make_format_list(out_pix_fmts);
352
-    ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats);
353
-    ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats);
352
+    ret = ff_formats_ref(in_fmts, &ctx->inputs[0]->out_formats);
353
+    if (ret < 0)
354
+        return ret;
355
+    ret = ff_formats_ref(out_fmts, &ctx->outputs[0]->in_formats);
356
+    if (ret < 0)
357
+        return ret;
354 358
 
355 359
     return 0;
356 360
 }