[vlc-devel] commit: Avoid integer overflow. Patch by Drew Yao. (Christophe Mutricy )

git version control git at videolan.org
Sun Mar 23 23:47:16 CET 2008


vlc | branch: 0.8.6-bugfix | Christophe Mutricy <xtophe at videolan.org> | Mon Mar 10 23:29:29 2008 +0000| [9cc8c304bc575fe984eaa711f6ac4ad58ca4a351]

Avoid integer overflow. Patch by Drew Yao.

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

 modules/codec/cinepak.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/codec/cinepak.c b/modules/codec/cinepak.c
index 8bad531..bc08c95 100644
--- a/modules/codec/cinepak.c
+++ b/modules/codec/cinepak.c
@@ -396,7 +396,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 );




More information about the vlc-devel mailing list