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

Francois Cartegnie git at videolan.org
Thu Feb 12 11:29:01 CET 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Feb 12 11:17:22 2015 +0100| [76a19597c8f3328adb2a46d7660aad1ebb8abd7c] | committer: Jean-Baptiste Kempf

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

(cherry picked from commit 0b37fc45954b2da51e452bb7111f32fa61d8edc5)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=76a19597c8f3328adb2a46d7660aad1ebb8abd7c
---

 modules/demux/ogg.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 5fd8e9a..3dea8a9 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1394,6 +1394,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