From: Edward Hervey Date: Wed, 14 Aug 2013 08:39:46 +0000 (+0200) Subject: pesparse: Fix pes extension data length check X-Git-Tag: 1.1.4~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddee83ef0bc13ce888a890f29650454e2c7ec496;p=platform%2Fupstream%2Fgst-plugins-bad.git pesparse: Fix pes extension data length check And remove length/data updates (we use the header size just below to properly set them). Based on feedback from Stas Sergeev https://bugzilla.gnome.org/show_bug.cgi?id=657343 --- diff --git a/gst/mpegtsdemux/pesparse.c b/gst/mpegtsdemux/pesparse.c index 258badc..ca1b990 100644 --- a/gst/mpegtsdemux/pesparse.c +++ b/gst/mpegtsdemux/pesparse.c @@ -336,7 +336,7 @@ mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res) goto bad_extension_marker_2; res->extension_field_length = val8 & 0x7f; - if (G_UNLIKELY (length < res->extension_field_length + 1)) + if (G_UNLIKELY (length < res->extension_field_length)) goto need_more_data; GST_LOG ("extension_field_length : %" G_GSIZE_FORMAT, @@ -354,9 +354,7 @@ mpegts_parse_pes_header (const guint8 * data, gsize length, PESHeader * res) } else { GST_LOG ("tref_extension : %d", flags & 0x01); } - data += res->extension_field_length; } - length -= res->extension_field_length + 1; } stuffing_byte: