mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
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:
parent
88c8e0681f
commit
8ac9ff3ff0
1 changed files with 2 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue