[vlc-commits] demux: mp4: early reject invalid timescale

Francois Cartegnie git at videolan.org
Sat Apr 29 15:08:24 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Apr 29 12:36:11 2017 +0200| [c5f14ee5c5578ea0dd623dba363b360700564409] | committer: Francois Cartegnie

demux: mp4: early reject invalid timescale

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

 modules/demux/mp4/mp4.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index f2fde6ecce..d94df9983d 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -771,7 +771,7 @@ 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;
@@ -779,8 +779,8 @@ static int Open( vlc_object_t * p_this )
     }
     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" ) ) )



More information about the vlc-commits mailing list