Clear memory before using it. (the buffer is read to get the old value before adding a voice to it and clipping it)

git-svn-id: https://svn.eduke32.com/eduke32@806 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
qbix79 2008-06-20 13:29:45 +00:00
parent 88c8e0681f
commit 8ac9ff3ff0

View file

@ -2872,7 +2872,8 @@ int MV_Init(int soundcard, int MixRate, int Voices, int numchannels, int sampleb
initprintf(" - Using %d byte mixing buffers\n", MixBufferSize);
// Allocate mix buffer within 1st megabyte
ptr = (char *)malloc(TotalBufferSize + 8); // FIXME: temporarily fixes bounds error somewhere...
// use calloc to clear the memory for the first playback.
ptr = (char *)calloc(1,TotalBufferSize + 8); // FIXME: temporarily fixes bounds error somewhere...
if (!ptr)
{
USRHOOKS_FreeMem(MV_Voices);