Commit b10a3596 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

libmp4: sidx: Return early if there are no items in the box

This also fixes a buffer overrun when MP4_VERBOSE is defined and i_count
is 0

(cherry picked from commit 45aee180)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 1c722060
......@@ -995,6 +995,8 @@ static int MP4_ReadBox_sidx( stream_t *p_stream, MP4_Box_t *p_box )
VLC_UNUSED(i_reserved);
MP4_GET2BYTES( i_reserved );
MP4_GET2BYTES( i_count );
if( i_count == 0 )
MP4_READBOX_EXIT( 1 );
p_sidx_data->i_reference_count = i_count;
p_sidx_data->p_items = vlc_alloc( i_count, sizeof( MP4_Box_sidx_item_t ) );
......
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