[FFmpeg-devel,v4,4/7] vf_misc_vaapi: Add missing return value checks

Submitted by Mark Thompson on April 9, 2019, 10:07 p.m.

Details

Message ID 20190409220730.29311-4-sw@jkqxz.net
State Accepted
Commit 5fb9eb9ed256d772609377ce356b8e22de9611d2
Headers show

Commit Message

Mark Thompson April 9, 2019, 10:07 p.m.
Parameter buffer creation can fail.
---
 libavfilter/vf_misc_vaapi.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_misc_vaapi.c b/libavfilter/vf_misc_vaapi.c
index 6f31a04293..6fbd453741 100644
--- a/libavfilter/vf_misc_vaapi.c
+++ b/libavfilter/vf_misc_vaapi.c
@@ -84,10 +84,9 @@  static int denoise_vaapi_build_filter_params(AVFilterContext *avctx)
     denoise.value =  map(ctx->denoise, DENOISE_MIN, DENOISE_MAX,
                          caps.range.min_value,
                          caps.range.max_value);
-    ff_vaapi_vpp_make_param_buffers(avctx, VAProcFilterParameterBufferType,
-                                    &denoise, sizeof(denoise), 1);
-
-    return 0;
+    return ff_vaapi_vpp_make_param_buffers(avctx,
+                                           VAProcFilterParameterBufferType,
+                                           &denoise, sizeof(denoise), 1);
 }
 
 static int sharpness_vaapi_build_filter_params(AVFilterContext *avctx)
@@ -116,11 +115,9 @@  static int sharpness_vaapi_build_filter_params(AVFilterContext *avctx)
                           SHARPNESS_MIN, SHARPNESS_MAX,
                           caps.range.min_value,
                           caps.range.max_value);
-    ff_vaapi_vpp_make_param_buffers(avctx,
-                                    VAProcFilterParameterBufferType,
-                                    &sharpness, sizeof(sharpness), 1);
-
-    return 0;
+    return ff_vaapi_vpp_make_param_buffers(avctx,
+                                           VAProcFilterParameterBufferType,
+                                           &sharpness, sizeof(sharpness), 1);
 }
 
 static int misc_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)