mpeg4videoparse: minor fix to error handling
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Tue, 7 Dec 2010 14:20:29 +0000 (15:20 +0100)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 8 Dec 2010 15:30:12 +0000 (16:30 +0100)
We weren't handling unparseable codec_data in some cases.

https://bugzilla.gnome.org/show_bug.cgi?id=635202

gst/mpeg4videoparse/mpeg4videoparse.c

index 09f3521..7dfa556 100644 (file)
@@ -731,6 +731,7 @@ gst_mpeg4vparse_sink_setcaps (GstPad * pad, GstCaps * caps)
     } else {
       const guint8 *data = GST_BUFFER_DATA (buf);
 
+      res = FALSE;
       if (data[0] == 0 && data[1] == 0 && data[2] == 1) {
         if (data[3] == VOS_STARTCODE) {
           /* Usually the codec data will be a visual object sequence, containing
@@ -745,6 +746,8 @@ gst_mpeg4vparse_sink_setcaps (GstPad * pad, GstCaps * caps)
           res = gst_mpeg4vparse_handle_vo (parse, data, GST_BUFFER_SIZE (buf),
               FALSE);
         }
+        if (!res)
+          goto failed_parse;
       } else {
         GST_WARNING_OBJECT (parse,
             "codec_data does not begin with start code, invalid");