Mercurial > mplayer.hg
changeset 32119:e2a7509972d4
Replace malloc+memset by calloc
author | reimar |
---|---|
date | Sun, 12 Sep 2010 15:48:46 +0000 |
parents | bb29c8d135ed |
children | 20bc9bdd7aa1 |
files | libmpdemux/demux_lmlm4.c libmpdemux/demux_rawdv.c |
diffstat | 2 files changed, 3 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_lmlm4.c Sun Sep 12 15:47:37 2010 +0000 +++ b/libmpdemux/demux_lmlm4.c Sun Sep 12 15:48:46 2010 +0000 @@ -310,8 +310,7 @@ 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 @@ 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;
--- a/libmpdemux/demux_rawdv.c Sun Sep 12 15:47:37 2010 +0000 +++ b/libmpdemux/demux_rawdv.c Sun Sep 12 15:48:46 2010 +0000 @@ -215,8 +215,7 @@ // 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;