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

git version control git at videolan.org
Wed Mar 26 19:34:53 CET 2008


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

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=27c7a7354f46f1ae0a8c606acb479294d5b83fd3
---

 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 ee06594..7efa0f2 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -472,6 +472,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;
     }
 
@@ -1995,6 +2000,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