Commit 9861846a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Rémi Denis-Courmont

MP4: do not nul time scale

Some MP4-knowledgeable dev (fenrir?) really should check that this is
not too restrictive a check.
parent f1d075cd
...@@ -460,6 +460,11 @@ static int Open( vlc_object_t * p_this ) ...@@ -460,6 +460,11 @@ static int Open( vlc_object_t * p_this )
else else
{ {
p_sys->i_timescale = p_mvhd->data.p_mvhd->i_timescale; p_sys->i_timescale = p_mvhd->data.p_mvhd->i_timescale;
if( p_sys->i_timescale == 0 )
{
msg_Err( p_this, "bad timescale" );
goto error;
}
p_sys->i_duration = p_mvhd->data.p_mvhd->i_duration; p_sys->i_duration = p_mvhd->data.p_mvhd->i_duration;
} }
...@@ -1780,6 +1785,8 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track, ...@@ -1780,6 +1785,8 @@ static void MP4_TrackCreate( demux_t *p_demux, mp4_track_t *p_track,
} }
p_track->i_timescale = p_mdhd->data.p_mdhd->i_timescale; p_track->i_timescale = p_mdhd->data.p_mdhd->i_timescale;
if( !p_track->i_timescale )
return;
for( i = 0; i < 3; i++ ) for( i = 0; i < 3; i++ )
{ {
......
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