demux: use calloc when applicable.
authorRémi Duraffort <ivoire@videolan.org>
Wed, 29 Jul 2009 11:52:35 +0000 (13:52 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 30 Jul 2009 12:03:09 +0000 (14:03 +0200)
include/vlc_demux.h

index 11444e2..e2858e8 100644 (file)
@@ -194,9 +194,9 @@ VLC_EXPORT( void, demux_PacketizerDestroy, ( decoder_t *p_packetizer ) );
 #define DEMUX_INIT_COMMON() do {            \
     p_demux->pf_control = Control;          \
     p_demux->pf_demux = Demux;              \
 #define DEMUX_INIT_COMMON() do {            \
     p_demux->pf_control = Control;          \
     p_demux->pf_demux = Demux;              \
-    p_demux->p_sys = malloc( sizeof( demux_sys_t ) ); \
+    p_demux->p_sys = calloc( 1, sizeof( demux_sys_t ) ); \
     if( !p_demux->p_sys ) return VLC_ENOMEM;\
     if( !p_demux->p_sys ) return VLC_ENOMEM;\
-    memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) ); } while(0)
+    } while(0)
 
 /**
  * @}
 
 /**
  * @}