From 77f254abb35dcedc3bb83ed1cc75f13fcec4265f Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 28 Oct 2013 09:33:16 +0100 Subject: [PATCH] h264parse: Avoid ending up with undefined values If caps aren't fixed, we'd end up with undefined values for format and align. --- gst/videoparsers/gsth264parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gst/videoparsers/gsth264parse.c b/gst/videoparsers/gsth264parse.c index 9e1d3c9eef..add29ed479 100644 --- a/gst/videoparsers/gsth264parse.c +++ b/gst/videoparsers/gsth264parse.c @@ -282,16 +282,16 @@ gst_h264_parse_get_string (GstH264Parse * parse, gboolean format, gint code) static void gst_h264_parse_format_from_caps (GstCaps * caps, guint * format, guint * align) { - g_return_if_fail (gst_caps_is_fixed (caps)); - - GST_DEBUG ("parsing caps: %" GST_PTR_FORMAT, caps); - if (format) *format = GST_H264_PARSE_FORMAT_NONE; if (align) *align = GST_H264_PARSE_ALIGN_NONE; + g_return_if_fail (gst_caps_is_fixed (caps)); + + GST_DEBUG ("parsing caps: %" GST_PTR_FORMAT, caps); + if (caps && gst_caps_get_size (caps) > 0) { GstStructure *s = gst_caps_get_structure (caps, 0); const gchar *str = NULL;