[FFmpeg-devel,2/4] lavfi/deinterlace_vaapi: fix typo and add check.

Submitted by Jun Zhao on Jan. 23, 2018, 4:33 a.m.

Details

Message ID 03074839-c99c-e69f-1abc-7cd9efd5118c@gmail.com
State New
Headers show

Commit Message

Jun Zhao Jan. 23, 2018, 4:33 a.m.
From 92294e97ffee609a2cac298f3ff0b51f3e3e37ef Mon Sep 17 00:00:00 2001
From: Jun Zhao <jun.zhao@intel.com>
Date: Tue, 23 Jan 2018 11:24:53 +0800
Subject: [PATCH 2/4] lavfi/deinterlace_vaapi: fix typo and add check.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
---
 libavfilter/vf_deinterlace_vaapi.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c
index 9700f85817..97b1d77840 100644
--- a/libavfilter/vf_deinterlace_vaapi.c
+++ b/libavfilter/vf_deinterlace_vaapi.c
@@ -33,7 +33,7 @@ 
 #define MAX_REFERENCES 8
 
 typedef struct DeintVAAPIContext {
-    VAAPIVPPContext vpp_ctx; // must be the first fileld
+    VAAPIVPPContext vpp_ctx; // must be the first field
 
     int                mode;
     int                field_rate;
@@ -285,8 +285,10 @@  static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
                 av_log(avctx, AV_LOG_ERROR, "Failed to unmap filter parameter "
                        "buffer: %d (%s).\n", vas, vaErrorStr(vas));
 
-            params.filters     = &vpp_ctx->filter_buffers[0];
-            params.num_filters = 1;
+            if (vpp_ctx->nb_filter_buffers) {
+                params.filters     = &vpp_ctx->filter_buffers[0];
+                params.num_filters = vpp_ctx->nb_filter_buffers;
+            }
 
             params.forward_references = forward_references;
             params.num_forward_references =