Skip to content

Commit

Permalink
spu: add a guard for "runaway" channels
Browse files Browse the repository at this point in the history
should really mask but it's inconvenient with the raw pointers used
there
  • Loading branch information
notaz committed Nov 21, 2023
1 parent 5e10acc commit 3059453
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/dfsound/spu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3059453

Please sign in to comment.