[vlc-commits] demux: ogg: check packets header size (fix #13875)

Francois Cartegnie git at videolan.org
Thu Feb 12 11:27:19 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 12 11:17:22 2015 +0100| [0b37fc45954b2da51e452bb7111f32fa61d8edc5] | committer: Francois Cartegnie

demux: ogg: check packets header size (fix #13875)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0b37fc45954b2da51e452bb7111f32fa61d8edc5
---

 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