Commit 344a3f20 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: ps: fix potential oob read

parent aab6bf54
......@@ -109,6 +109,8 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id, bloc
if( ( i_id&0xf0 ) == 0xc0 && p_pkt && p_pkt->i_buffer > 8 )
{
unsigned i_start = 9 + p_pkt->p_buffer[8];
if( i_start + 9 < p_pkt->i_buffer )
{
/* AC-3 marking, see vlc_a52_header_Parse */
if( p_pkt->p_buffer[i_start + 4] == 0x0b ||
p_pkt->p_buffer[i_start + 5] == 0x77 )
......@@ -118,6 +120,7 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id, bloc
b_eac3 = true;
}
}
}
es_format_Init( &tk->fmt, AUDIO_ES, b_eac3 ? VLC_CODEC_EAC3 : VLC_CODEC_A52 );
tk->i_skip = 4;
......
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