deinterlace: guard against finding no suitable pattern
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 7 Apr 2014 11:16:17 +0000 (12:16 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 7 Apr 2014 11:20:12 +0000 (12:20 +0100)
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

index 7b00b11..3d20879 100644 (file)
@@ -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);