[MPlayer-cvslog] r32203 - in trunk/libmpdemux: demux_lmlm4.c demux_rawdv.c

reimar subversion at mplayerhq.hu
Sun Sep 12 17:48:46 CEST 2010


Author: reimar
Date: Sun Sep 12 17:48:46 2010
New Revision: 32203

Log:
Replace malloc+memset by calloc

Modified:
   trunk/libmpdemux/demux_lmlm4.c
   trunk/libmpdemux/demux_rawdv.c

Modified: trunk/libmpdemux/demux_lmlm4.c
==============================================================================
--- trunk/libmpdemux/demux_lmlm4.c	Sun Sep 12 17:47:37 2010	(r32202)
+++ trunk/libmpdemux/demux_lmlm4.c	Sun Sep 12 17:48:46 2010	(r32203)
@@ -310,8 +310,7 @@ static demuxer_t* demux_open_lmlm4(demux
     sh_video->disp_h = 480;
     sh_video->format = mmioFOURCC('D','I','V','X');
 
-    sh_video->bih = malloc(sizeof(BITMAPINFOHEADER));
-    memset(sh_video->bih, 0, sizeof(BITMAPINFOHEADER));
+    sh_video->bih = calloc(1, sizeof(BITMAPINFOHEADER));
 
     /* these are false values */
     sh_video->bih->biSize = 40;
@@ -326,8 +325,7 @@ static demuxer_t* demux_open_lmlm4(demux
     demuxer->audio->sh = sh_audio;
     sh_audio->ds = demuxer->audio;
 
-    sh_audio->wf = malloc(sizeof(WAVEFORMATEX));
-    memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX));
+    sh_audio->wf = calloc(1, sizeof(WAVEFORMATEX));
 
     sh_audio->samplerate = 48000;
     sh_audio->wf->wBitsPerSample = 16;

Modified: trunk/libmpdemux/demux_rawdv.c
==============================================================================
--- trunk/libmpdemux/demux_rawdv.c	Sun Sep 12 17:47:37 2010	(r32202)
+++ trunk/libmpdemux/demux_rawdv.c	Sun Sep 12 17:48:46 2010	(r32203)
@@ -215,8 +215,7 @@ static demuxer_t* demux_open_rawdv(demux
        // custom fourcc for internal MPlayer use
        sh_audio->format = mmioFOURCC('R', 'A', 'D', 'V');
 
-	sh_audio->wf = malloc(sizeof(WAVEFORMATEX));
-	memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX));
+	sh_audio->wf = calloc(1, sizeof(WAVEFORMATEX));
 	sh_audio->wf->wFormatTag = sh_audio->format;
 	sh_audio->wf->nChannels = dv_decoder->audio->num_channels;
 	sh_audio->wf->wBitsPerSample = 16;


More information about the MPlayer-cvslog mailing list