[vlc-devel] commit: quicktime codec: prevent malloc(0) (Derk-Jan Hartman )
git version control
git at videolan.org
Sat Jul 19 22:22:50 CEST 2008
vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Sat Jul 19 22:21:38 2008 +0200| [08a33c8da72d461caf217c0bbcf745c90b56228e]
quicktime codec: prevent malloc(0)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=08a33c8da72d461caf217c0bbcf745c90b56228e
---
modules/codec/quicktime.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/codec/quicktime.c b/modules/codec/quicktime.c
index 6501d94..7f6eb31 100644
--- a/modules/codec/quicktime.c
+++ b/modules/codec/quicktime.c
@@ -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;
More information about the vlc-devel
mailing list