oggstream: correctly identify skeleton EOS packet
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Tue, 23 Aug 2011 10:05:11 +0000 (11:05 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 24 Aug 2011 06:31:51 +0000 (08:31 +0200)
It is 0 byte, and was triggering the "bad packet" logic.

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

ext/ogg/gstoggstream.c

index abc5910..c58daea 100644 (file)
@@ -1111,12 +1111,15 @@ gst_ogg_map_parse_fisbone (GstOggStream * pad, const guint8 * data, guint size,
   GstOggSkeleton stype;
   guint serial_offset;
 
-  if (size < SKELETON_FISBONE_MIN_SIZE) {
+  if (size != 0 && size < SKELETON_FISBONE_MIN_SIZE) {
     GST_WARNING ("small fisbone packet of size %d, ignoring", size);
     return FALSE;
   }
 
-  if (memcmp (data, "fisbone\0", 8) == 0) {
+  if (size == 0) {
+    /* Skeleton EOS packet is zero bytes */
+    return FALSE;
+  } else if (memcmp (data, "fisbone\0", 8) == 0) {
     GST_INFO ("got fisbone packet");
     stype = GST_OGG_SKELETON_FISBONE;
     serial_offset = 12;