vf_scale_vaapi: Add missing return value checks
authorMark Thompson <sw@jkqxz.net>
Mon, 9 Jan 2017 00:59:50 +0000 (00:59 +0000)
committerMark Thompson <sw@jkqxz.net>
Sun, 5 Feb 2017 15:13:16 +0000 (15:13 +0000)
Fixes CID 1374119.

libavfilter/vf_scale_vaapi.c

index 604cd95..5e6298a 100644 (file)
@@ -65,11 +65,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;
 }