mpegpsdemux: fix zero length packet handling
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 3 Oct 2011 17:28:14 +0000 (18:28 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Mon, 7 Nov 2011 11:17:00 +0000 (11:17 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=631416

gst/mpegdemux/gstpesfilter.c

index 18d503608cca7672334b593ff76a31c62059f78a..23b205a590d986423c9e7c59f1e2a6f30ba24334 100644 (file)
@@ -168,7 +168,7 @@ gst_pes_filter_parse (GstPESFilter * filter)
     avail = MIN (avail, filter->length + 6);
   }
 
-  if (avail < 7)
+  if (avail < 6)
     goto need_more_data;
 
   /* read more data, either the whole packet if there is a length
@@ -202,6 +202,8 @@ gst_pes_filter_parse (GstPESFilter * filter)
       break;
   }
 
+  if (datalen == 0)
+    goto need_more_data;
   filter->pts = filter->dts = -1;
 
   /* stuffing bits, first two bits are '10' for mpeg2 pes so this code is