[vlc-devel] commit: Check allocation and initialise memory ( Rafaël Carré )

git version control git at videolan.org
Tue May 20 15:16:15 CEST 2008


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue May 20 15:06:24 2008 +0200| [e8120e68db7397af96173ee53cbffdab45f6c171]

Check allocation and initialise memory

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

 modules/packetizer/mpegvideo.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index 168ae51..a0443dd 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;




More information about the vlc-devel mailing list