[vlc-devel] [PATCH] avi: Fix potential integer overflow

Hugo Beauzée-Luyssen hugo at beauzee.fr
Sun Nov 12 10:03:33 CET 2017


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

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 190a6be209..f8af53bcd9 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -1800,10 +1800,10 @@ static mtime_t AVI_GetDPTS( avi_track_t *tk, int64_t i_count )
     if( !tk->i_rate )
         return i_dpts;
 
-    i_dpts = (mtime_t)( (int64_t)1000000 *
-                        (int64_t)i_count *
+    i_dpts = (mtime_t)( (int64_t)i_count *
                         (int64_t)tk->i_scale /
                         (int64_t)tk->i_rate );
+    i_dpts *= (int64_t)1000000;
 
     if( tk->i_samplesize )
     {
-- 
2.11.0



More information about the vlc-devel mailing list