mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-21 20:11:12 +00:00
Fix crash with GME sounds when being freed
This commit is contained in:
parent
181ecee202
commit
64bb70bef4
1 changed files with 2 additions and 2 deletions
|
@ -390,7 +390,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);
|
||||||
|
@ -463,7 +463,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);
|
||||||
|
|
Loading…
Reference in a new issue