rawvideoparse: fix assert on large width/height in caps
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Tue, 21 Mar 2017 13:12:47 +0000 (13:12 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 27 Mar 2017 10:27:19 +0000 (11:27 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=776446

gst/rawparse/gstrawbaseparse.c

index 2e7e705..933e59f 100644 (file)
@@ -525,7 +525,12 @@ gst_raw_base_parse_handle_frame (GstBaseParse * parse,
   frame_size =
       klass->get_config_frame_size (raw_base_parse,
       GST_RAW_BASE_PARSE_CONFIG_CURRENT);
-  g_assert (frame_size > 0);
+  if (frame_size <= 0) {
+    GST_ELEMENT_ERROR (parse, STREAM, FORMAT,
+        ("Non strictly positive frame size"), (NULL));
+    flow_ret = GST_FLOW_ERROR;
+    goto error_locked;
+  }
 
   in_size = gst_buffer_get_size (frame->buffer);