]> git.sesse.net Git - vlc/commitdiff
quicktime codec: prevent malloc(0)
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 19 Jul 2008 20:21:38 +0000 (22:21 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 19 Jul 2008 20:21:38 +0000 (22:21 +0200)
modules/codec/quicktime.c

index 6501d94eabd017b344a52a6febc9720a861eb52c..7f6eb31117830dbdd1d0d9c55932d4c5c55d21b7 100644 (file)
@@ -804,7 +804,8 @@ static int OpenVideo( decoder_t *p_dec )
     p_sys->framedescHandle = (ImageDescriptionHandle) NewHandleClear( id->idSize );
     memcpy( *p_sys->framedescHandle, id, id->idSize );
 
-    p_sys->plane = malloc( p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 3 );
+    if( p_dec->fmt_in.video.i_width != 0 && p_dec->fmt_in.video.i_height != 0) 
+        p_sys->plane = malloc( p_dec->fmt_in.video.i_width * p_dec->fmt_in.video.i_height * 3 );
     if( !p_sys->plane )
         goto exit_error;