From: Rafaël Carré Date: Tue, 20 May 2008 13:06:24 +0000 (+0200) Subject: Check allocation and initialise memory X-Git-Tag: 0.9.0-test0~866 X-Git-Url: http://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;p=vlc.git;a=commitdiff_plain;h=e8120e68db7397af96173ee53cbffdab45f6c171 Check allocation and initialise memory --- diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c index 168ae51fe8..a0443ddb99 100644 --- a/modules/packetizer/mpegvideo.c +++ b/modules/packetizer/mpegvideo.c @@ -164,6 +164,9 @@ static int Open( vlc_object_t *p_this ) p_dec->pf_get_cc = GetCc; p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) ); + if( !p_dec->p_sys ) + return VLC_ENOMEM; + memset( p_dec->p_sys, 0, sizeof( decoder_sys_t ) ); /* Misc init */ p_sys->i_state = STATE_NOSYNC;