]> git.sesse.net Git - vlc/commitdiff
Avoid integer overflow. Patch by Drew Yao.
authorChristophe Mutricy <xtophe@videolan.org>
Mon, 10 Mar 2008 23:29:29 +0000 (23:29 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Mon, 10 Mar 2008 23:29:29 +0000 (23:29 +0000)
modules/codec/cinepak.c

index 09b491b5f6ff3b2fca179b878eea9e3b4fd9452f..97f52334996a39cb36c8375b1f76eea474e9834f 100644 (file)
@@ -397,7 +397,8 @@ static int cinepak_decode_frame( cinepak_context_t *p_context,
     i_height = GET2BYTES( p_data );
     i_frame_strips = GET2BYTES( p_data );
 
-    if( !i_frame_size || !i_width || !i_height )
+    if( !i_frame_size || !i_width || !i_height ||
+        i_width > 0xffff-3 || i_height > 0xffff-3)
     {
         /* Broken header */
         return( -1 );