Commit 76a19597 authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

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

(cherry picked from commit 0b37fc45954b2da51e452bb7111f32fa61d8edc5)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent fb43d327
...@@ -1394,6 +1394,13 @@ static void Ogg_DecodePacket( demux_t *p_demux, ...@@ -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_BITS01) >> 6;
i_header_len |= (*p_oggpacket->packet & PACKET_LEN_BITS2) << 1; 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) if( p_stream->fmt.i_codec == VLC_CODEC_SUBT)
{ {
/* But with subtitles we need to retrieve the duration first */ /* But with subtitles we need to retrieve the duration first */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment