[vlc-devel] commit: MP4: do not nul time scale ( Rémi Denis-Courmont )

git version control git at videolan.org
Fri Mar 28 16:05:02 CET 2008


vlc | branch: 0.8.6-bugfix | Rémi Denis-Courmont <rem at videolan.org> | Wed Mar 26 20:34:31 2008 +0200| [9861846a09ccc064002bff627045b214ac9b082d]

MP4: do not nul time scale

Some MP4-knowledgeable dev (fenrir?) really should check that this is
not too restrictive a check.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9861846a09ccc064002bff627045b214ac9b082d
---

 modules/demux/mp4/mp4.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index ed9af7d..deaf781 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -460,6 +460,11 @@ static int Open( vlc_object_t * p_this )
     else
     {
         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;
     }
 
@@ -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;
+    if( !p_track->i_timescale )
+        return;
 
     for( i = 0; i < 3; i++ )
     {




More information about the vlc-devel mailing list