From 305945333b4ec7d6910a077278c850b1cd887057 Mon Sep 17 00:00:00 2001 From: notaz Date: Wed, 22 Nov 2023 01:06:05 +0200 Subject: [PATCH] spu: add a guard for "runaway" channels should really mask but it's inconvenient with the raw pointers used there --- plugins/dfsound/spu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5