deinterlace: fix sign comparison
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 16 Apr 2014 16:25:44 +0000 (17:25 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 16 Apr 2014 16:44:51 +0000 (17:44 +0100)
history_count is unsigned, so the whole comparison will be made
as unsigned, and fail to reject what it was meant to.

Coverity 206204

gst/deinterlace/gstdeinterlace.c

index 3d20879..b669302 100644 (file)
@@ -1872,8 +1872,8 @@ restart:
     if (ret != GST_FLOW_OK)
       goto no_buffer;
 
-    g_return_val_if_fail (self->history_count - 1 -
-        gst_deinterlace_method_get_latency (self->method) >= 0, GST_FLOW_ERROR);
+    g_return_val_if_fail (self->history_count >=
+        gst_deinterlace_method_get_latency (self->method) + 1, GST_FLOW_ERROR);
 
     buf =
         self->field_history[self->history_count - 1 -