[vlc-devel] commit: demux: use calloc when applicable. ( Rémi Duraffort )

git version control git at videolan.org
Thu Jul 30 14:34:04 CEST 2009


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Jul 29 13:52:35 2009 +0200| [e533549b83a91a1a9e732eeb2ae032a715bd1acf] | committer: Rémi Duraffort 

demux: use calloc when applicable.

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

 include/vlc_demux.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index 11444e2..e2858e8 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -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;              \
-    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;\
-    memset( p_demux->p_sys, 0, sizeof( demux_sys_t ) ); } while(0)
+    } while(0)
 
 /**
  * @}




More information about the vlc-devel mailing list