diff --git a/polymer/eduke32/source/jaudiolib/src/driver_sdl.c b/polymer/eduke32/source/jaudiolib/src/driver_sdl.c index be41910b1..032268689 100644 --- a/polymer/eduke32/source/jaudiolib/src/driver_sdl.c +++ b/polymer/eduke32/source/jaudiolib/src/driver_sdl.c @@ -185,8 +185,7 @@ int32_t SDLDrv_PCM_Init(int32_t *mixrate, int32_t *numchannels, int32_t *sampleb // dummy channel 2 runs our fillData() callback as an effect Mix_RegisterEffect(2, fillData, NULL, NULL); - DummyBuffer = (uint8_t *) malloc(chunksize); - memset(DummyBuffer, 0, chunksize); + DummyBuffer = (uint8_t *) calloc(1, chunksize); DummyChunk = Mix_QuickLoad_RAW(DummyBuffer, chunksize); diff --git a/polymer/eduke32/source/jaudiolib/src/flac.c b/polymer/eduke32/source/jaudiolib/src/flac.c index ef123a15b..1e52dd912 100644 --- a/polymer/eduke32/source/jaudiolib/src/flac.c +++ b/polymer/eduke32/source/jaudiolib/src/flac.c @@ -450,13 +450,12 @@ int32_t MV_PlayFLAC return MV_Error; } - fd = (flac_data *) malloc( sizeof(flac_data) ); + fd = (flac_data *) calloc( 1, sizeof(flac_data) ); if (!fd) { MV_SetErrorCode( MV_InvalidFLACFile ); return MV_Error; } - memset(fd, 0, sizeof(flac_data)); fd->ptr = ptr; fd->pos = 0; fd->blocksize = 0; diff --git a/polymer/eduke32/source/jaudiolib/src/vorbis.c b/polymer/eduke32/source/jaudiolib/src/vorbis.c index da0957bb8..ab4f8151e 100644 --- a/polymer/eduke32/source/jaudiolib/src/vorbis.c +++ b/polymer/eduke32/source/jaudiolib/src/vorbis.c @@ -406,13 +406,12 @@ int32_t MV_PlayVorbis return MV_Error; } - vd = (vorbis_data *) malloc( sizeof(vorbis_data) ); + vd = (vorbis_data *) calloc( 1, sizeof(vorbis_data) ); if (!vd) { MV_SetErrorCode( MV_InvalidVorbisFile ); return MV_Error; } - memset(vd, 0, sizeof(vorbis_data)); vd->ptr = ptr; vd->pos = 0; vd->length = ptrlength; diff --git a/polymer/eduke32/source/jaudiolib/src/xa.c b/polymer/eduke32/source/jaudiolib/src/xa.c index c2882f7a0..6ee5381b3 100644 --- a/polymer/eduke32/source/jaudiolib/src/xa.c +++ b/polymer/eduke32/source/jaudiolib/src/xa.c @@ -458,13 +458,12 @@ int32_t MV_PlayXA return MV_Error; } - xad = (xa_data *) malloc( sizeof(xa_data) ); + xad = (xa_data *) calloc( 1, sizeof(xa_data) ); if (!xad) { MV_SetErrorCode( MV_InvalidXAFile ); return MV_Error; } - memset(xad, 0, sizeof(xa_data)); xad->ptr = ptr; xad->pos = XA_DATA_START; xad->blocksize = 0;