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

mp4: Fix crash on empty ELST

(cherry picked from commit e198d07c)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent b10a3596
......@@ -3214,6 +3214,9 @@ static int MP4_ReadBox_elst( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GETVERSIONFLAGS( p_box->data.p_elst );
MP4_GET4BYTES( count );
if( count == 0 )
MP4_READBOX_EXIT( 1 );
uint32_t i_entries_max = i_read / ((p_box->data.p_elst->i_version == 1) ? 20 : 12);
if( count > i_entries_max )
count = i_entries_max;
......
......@@ -319,7 +319,7 @@ static inline int64_t MP4_TrackGetDTS( demux_t *p_demux, mp4_track_t *p_track )
}
/* now handle elst */
if( p_track->p_elst )
if( p_track->p_elst && p_track->BOXDATA(p_elst)->i_entry_count )
{
MP4_Box_data_elst_t *elst = p_track->BOXDATA(p_elst);
......
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