[vlc-commits] demux: tta: check alloc for i_extra overflow

Francois Cartegnie git at videolan.org
Thu Mar 23 21:11:41 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Mar 23 21:06:46 2017 +0100| [ffa3a9f3ec42032e3bd196dc699d2fee2441cfa9] | committer: Francois Cartegnie

demux: tta: check alloc for i_extra overflow

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

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

diff --git a/modules/demux/tta.c b/modules/demux/tta.c
index aad60d6..98c7ff0 100644
--- a/modules/demux/tta.c
+++ b/modules/demux/tta.c
@@ -33,6 +33,7 @@
 #include <vlc_demux.h>
 #include <vlc_codec.h>
 #include <math.h>
+#include <limits.h>
 
 /*****************************************************************************
  * Module descriptor
@@ -134,7 +135,7 @@ static int Open( vlc_object_t * p_this )
     p_sys->i_totalframes = p_sys->i_datalength / p_sys->i_framelength +
                           ((p_sys->i_datalength % p_sys->i_framelength) != 0);
     p_sys->i_currentframe = 0;
-    if( p_sys->i_totalframes > (1 << 29))
+    if( (INT_MAX - 22 - 4) / sizeof(uint32_t) < p_sys->i_totalframes )
         goto error;
 
     i_seektable_size = sizeof(uint32_t)*p_sys->i_totalframes;



More information about the vlc-commits mailing list