[vlc-commits] demux: ogg: check packets header size (fix #13859)
Francois Cartegnie
git at videolan.org
Thu Feb 12 11:21:59 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 12 11:17:22 2015 +0100| [f0a6a4c0a6352ded861aef90eb701472f77b8e61] | committer: Francois Cartegnie
demux: ogg: check packets header size (fix #13859)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f0a6a4c0a6352ded861aef90eb701472f77b8e61
---
modules/demux/ogg.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 6e0a500..8326b4e 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1408,6 +1408,13 @@ static void Ogg_DecodePacket( demux_t *p_demux,
i_header_len = (*p_oggpacket->packet & PACKET_LEN_BITS01) >> 6;
i_header_len |= (*p_oggpacket->packet & PACKET_LEN_BITS2) << 1;
+ if( i_header_len >= p_oggpacket->bytes )
+ {
+ msg_Dbg( p_demux, "discarding invalid packet" );
+ block_Release( p_block );
+ return;
+ }
+
if( p_stream->fmt.i_codec == VLC_CODEC_SUBT)
{
/* But with subtitles we need to retrieve the duration first */
More information about the vlc-commits
mailing list