From 700d6782cee67d7d9f42bbdad33fbba55cc9ea33 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Thu, 31 May 2018 18:21:58 -0800 Subject: [PATCH] codecparsers: mpeg2: don't mess the StartCode only packets 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/codecparsers/gstmpegvideoparser.c b/gst-libs/gst/codecparsers/gstmpegvideoparser.c index 5d0e6a7..408ae03 100644 --- a/gst-libs/gst/codecparsers/gstmpegvideoparser.c +++ b/gst-libs/gst/codecparsers/gstmpegvideoparser.c @@ -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; -- 2.7.4