ogmparse: Error out if we can't figure out the format
authorEdward Hervey <edward@centricular.com>
Wed, 1 Nov 2017 09:31:28 +0000 (10:31 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 1 Nov 2017 09:32:54 +0000 (10:32 +0100)
In some cases we might not be able to figure out the fixed format
from the header.

Properly error out in those cases.

ext/ogg/gstogmparse.c

index a4b553e..fc00538 100644 (file)
@@ -615,6 +615,9 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size)
   if (caps == NULL)
     goto cannot_decode;
 
+  if (!gst_caps_is_fixed (caps))
+    goto non_fixed_caps;
+
   if (ogm->srcpad) {
     GstCaps *current_caps = gst_pad_get_current_caps (ogm->srcpad);
 
@@ -679,6 +682,12 @@ cannot_decode:
     GST_ELEMENT_ERROR (ogm, STREAM, DECODE, (NULL), ("unknown ogm format"));
     return GST_FLOW_ERROR;
   }
+non_fixed_caps:
+  {
+    gst_caps_unref (caps);
+    GST_ELEMENT_ERROR (ogm, STREAM, DECODE, (NULL), ("broken ogm format"));
+    return GST_FLOW_ERROR;
+  }
 }
 
 static GstFlowReturn