[vlc-commits] demux: mp4: fix integer overflow (fix #12074)

Francois Cartegnie git at videolan.org
Wed Sep 3 14:17:58 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep  3 14:15:49 2014 +0200| [0ff2de0533d1197d2dc2f17ad9093cc7b9541402] | committer: Francois Cartegnie

demux: mp4: fix integer overflow (fix #12074)

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

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

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 2185391..8682513 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -982,13 +982,14 @@ end:
                 continue;
 
             mtime_t i_dts = MP4_TrackGetDTS( p_demux, tk );
+            p_sys->i_pcr = __MIN( i_dts, p_sys->i_pcr );
+
             if ( !p_sys->b_seekmode && i_dts > p_sys->i_pcr + 2*CLOCK_FREQ )
             {
                 msg_Dbg( p_demux, "that media doesn't look interleaved, will need to seek");
                 p_sys->b_seekmode = true;
             }
 
-            p_sys->i_pcr = __MIN( i_dts, p_sys->i_pcr );
             p_sys->i_time = p_sys->i_pcr * p_sys->i_timescale / CLOCK_FREQ;
         }
     }



More information about the vlc-commits mailing list