codecparsers: mpeg2: don't mess the StartCode only packets
authorSreerenj Balachandran <sreerenj.balachandran@intel.com>
Fri, 1 Jun 2018 02:21:58 +0000 (18:21 -0800)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 1 Jun 2018 06:17:09 +0000 (08:17 +0200)
It is completely legal to have packets with zero sizes.
Zero-sized packet indicates header with only Start Code.
One eg: is user data packet. The patch allows having
GstMpegVideoPacket with zero sizes.

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

gst-libs/gst/codecparsers/gstmpegvideoparser.c

index 5d0e6a7..408ae03 100644 (file)
@@ -264,7 +264,7 @@ gst_mpeg_video_parse (GstMpegVideoPacket * packet,
   size -= off + 4;
   off = scan_for_start_codes (&br, 0, size);
 
-  if (off > 0)
+  if (off >= 0)
     packet->size = off;
 
   return TRUE;