Fix crash with GME sounds when being freed

This commit is contained in:
Steel Titanium 2019-07-14 14:55:04 -04:00
parent 016f1fe533
commit 4e839596a1
No known key found for this signature in database
GPG key ID: 924BA411F18DFDBE

View file

@ -362,7 +362,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0); gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2; len = (info->play_length * 441 / 10) << 2;
mem = malloc(len); mem = Z_Malloc(len, PU_SOUND, 0);
gme_play(emu, len >> 1, mem); gme_play(emu, len >> 1, mem);
gme_free_info(info); gme_free_info(info);
gme_delete(emu); gme_delete(emu);
@ -435,7 +435,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0); gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2; len = (info->play_length * 441 / 10) << 2;
mem = malloc(len); mem = Z_Malloc(len, PU_SOUND, 0);
gme_play(emu, len >> 1, mem); gme_play(emu, len >> 1, mem);
gme_free_info(info); gme_free_info(info);
gme_delete(emu); gme_delete(emu);