From 1d7735b1d625195ca61812d5fe8ecc2632521256 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Mon, 7 Apr 2014 12:16:17 +0100 Subject: [PATCH] deinterlace: guard against finding no suitable pattern The code handles a -1 pattern index, and it seems plausible that a pattern might be found later, so it seems best to not send an element error here. Coverity 1139766 --- gst/deinterlace/gstdeinterlace.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index 7b00b11e9d..3d2087921f 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -1425,6 +1425,11 @@ gst_deinterlace_get_pattern_lock (GstDeinterlace * self, gboolean * flush_one) } } + if (pattern < 0) { + GST_WARNING_OBJECT (self, "Failed to select a pattern"); + return; + } + GST_DEBUG_OBJECT (self, "Final pattern match result: pa %d, ph %d, l %d, s %d", pattern, phase, telecine_patterns[pattern].length, score); -- 2.34.1