ogmparse: Error out if we can't figure out the format

In some cases we might not be able to figure out the fixed format
from the header.

Properly error out in those cases.
This commit is contained in:
Edward Hervey 2017-11-01 10:31:28 +01:00 committed by Edward Hervey
parent 33709106e9
commit 0297bc2a4f

View file

@ -615,6 +615,9 @@ gst_ogm_parse_stream_header (GstOgmParse * ogm, const guint8 * data, guint size)
if (caps == NULL) if (caps == NULL)
goto cannot_decode; goto cannot_decode;
if (!gst_caps_is_fixed (caps))
goto non_fixed_caps;
if (ogm->srcpad) { if (ogm->srcpad) {
GstCaps *current_caps = gst_pad_get_current_caps (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")); GST_ELEMENT_ERROR (ogm, STREAM, DECODE, (NULL), ("unknown ogm format"));
return GST_FLOW_ERROR; 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 static GstFlowReturn