Use plain malloc instead of Z_Malloc to allocate sound buffers in mixer_sound.c's I_GetSfx.

This should prevent I_FreeSfx making a mess of things later, hopefully.
This commit is contained in:
Monster Iestyn 2018-07-14 18:15:59 +01:00
parent 8e19611033
commit 6b1fa399dc

View file

@ -176,7 +176,7 @@ static Mix_Chunk *ds2chunk(void *stream)
return NULL; // would and/or did wrap, can't store.
break;
}
sound = Z_Malloc(newsamples<<2, PU_SOUND, NULL); // samples * frequency shift * bytes per sample * channels
sound = malloc(newsamples<<2); // samples * frequency shift * bytes per sample * channels
s = (SINT8 *)stream;
d = (INT16 *)sound;
@ -304,7 +304,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2;
mem = Z_Malloc(len, PU_SOUND, NULL);
mem = malloc(len);
gme_play(emu, len >> 1, mem);
gme_delete(emu);
@ -376,7 +376,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2;
mem = Z_Malloc(len, PU_SOUND, NULL);
mem = malloc(len);
gme_play(emu, len >> 1, mem);
gme_delete(emu);