[vlc-commits] demux: mp4: fill fragmented timescale on missing mvhd

Francois Cartegnie git at videolan.org
Tue Aug 23 10:33:57 CEST 2016


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Aug 22 16:52:10 2016 +0800| [85a64e10d665edf8a29526543b5c6fd4923437fd] | committer: Jean-Baptiste Kempf

demux: mp4: fill fragmented timescale on missing mvhd

Potential divide-by-zero issue.
Reported-by: Xiangkun Jia (ajax4sec at hotmail.com)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/mp4/mp4.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 944d39b..d41b84b 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -4428,6 +4428,12 @@ static bool AddFragment( demux_t *p_demux, MP4_Box_t *p_moox )
                 p_sys->i_timescale = BOXDATA(p_mvhd)->i_timescale;
                 p_sys->i_overall_duration = BOXDATA(p_mvhd)->i_duration;
             }
+            else
+            {
+                p_sys->i_timescale = CLOCK_FREQ;
+                p_sys->i_overall_duration = CLOCK_FREQ;
+                msg_Warn( p_demux, "No valid mvhd found" );
+            }
 
             if ( MP4_BoxCount( p_moox, "mvex" ) || !p_mvhd )
             { /* duration might be wrong an be set to whole duration :/ */



More information about the vlc-commits mailing list