Skip to content

Commit

Permalink
demux: mp4: early reject invalid timescale
Browse files Browse the repository at this point in the history
  • Loading branch information
fcartegnie committed Apr 29, 2017
1 parent bd5e93e commit c5f14ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/demux/mp4/mp4.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,16 +771,16 @@ static int Open( vlc_object_t * p_this )
}

p_mvhd = MP4_BoxGet( p_sys->p_moov, "mvhd" );
if( p_mvhd && BOXDATA(p_mvhd) )
if( p_mvhd && BOXDATA(p_mvhd) && BOXDATA(p_mvhd)->i_timescale )
{
p_sys->i_timescale = BOXDATA(p_mvhd)->i_timescale;
p_sys->i_moov_duration = p_sys->i_duration = BOXDATA(p_mvhd)->i_duration;
p_sys->i_cumulated_duration = BOXDATA(p_mvhd)->i_duration;
}
else
{
p_sys->i_timescale = CLOCK_FREQ;
msg_Warn( p_demux, "No valid mvhd found" );
goto error;
}

if( ( p_rmra = MP4_BoxGet( p_sys->p_root, "/moov/rmra" ) ) )
Expand Down

0 comments on commit c5f14ee

Please sign in to comment.