matroskaparse: ignore parsing errors at the end of the file
authorNicola Murino <nicola.murino@gmail.com>
Wed, 16 Nov 2016 21:39:01 +0000 (22:39 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 17 Nov 2016 08:20:56 +0000 (10:20 +0200)
This is the same change as a3a55305 for the parser.

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

gst/matroska/matroska-parse.c

index 97c57e7..291819b 100644 (file)
@@ -3011,8 +3011,13 @@ next:
 
   ret = gst_matroska_read_common_peek_id_length_push (&parse->common,
       GST_ELEMENT_CAST (parse), &id, &length, &needed);
-  if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_EOS))
+  if (G_UNLIKELY (ret != GST_FLOW_OK && ret != GST_FLOW_EOS)) {
+    if (parse->common.ebml_segment_length != G_MAXUINT64
+        && parse->common.offset >=
+        parse->common.ebml_segment_start + parse->common.ebml_segment_length)
+      ret = GST_FLOW_EOS;
     return ret;
+  }
 
   GST_LOG_OBJECT (parse, "Offset %" G_GUINT64_FORMAT ", Element id 0x%x, "
       "size %" G_GUINT64_FORMAT ", needed %d, available %d",