From: notaz Date: Tue, 21 Nov 2023 23:06:05 +0000 (+0200) Subject: spu: add a guard for "runaway" channels X-Git-Tag: r24~41 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f05ce78eb3a05c582928ca320267e7a783868264;p=pcsx_rearmed.git spu: add a guard for "runaway" channels should really mask but it's inconvenient with the raw pointers used there --- diff --git a/plugins/dfsound/spu.c b/plugins/dfsound/spu.c index 1cc1cbf9..6671e3ed 100644 --- a/plugins/dfsound/spu.c +++ b/plugins/dfsound/spu.c @@ -1551,7 +1551,10 @@ long CALLBACK SPUinit(void) int i; memset(&spu, 0, sizeof(spu)); - spu.spuMemC = calloc(1, 512 * 1024); + spu.spuMemC = calloc(1, 512 * 1024 + 16); + // a guard for runaway channels - End+Mute + spu.spuMemC[512 * 1024 + 1] = 1; + InitADSR(); spu.s_chan = calloc(MAXCHAN+1, sizeof(spu.s_chan[0])); // channel + 1 infos (1 is security for fmod handling)