From bcf877b7cadb870a0ba1a5d6780ba19cecdca34c Mon Sep 17 00:00:00 2001 From: tildearrow Date: Mon, 28 Aug 2023 04:12:09 -0500 Subject: [PATCH] C219: fix out of bounds access --- src/engine/platform/sound/c140_c219.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/platform/sound/c140_c219.c b/src/engine/platform/sound/c140_c219.c index 4855bd782..67aa6dc4c 100644 --- a/src/engine/platform/sound/c140_c219.c +++ b/src/engine/platform/sound/c140_c219.c @@ -175,8 +175,8 @@ void c219_voice_tick(struct c219_t *c219, const unsigned char v, const int cycle signed short s2 = c219->sample_mem[((unsigned int)(c219->bank[(v >> 2) & 3]) << 17) | ((voice->addr + 1) & 0x1ffff)]; if (voice->compressed) { - s1 = c219->mulaw[s1]; - s2 = c219->mulaw[s2]; + s1 = c219->mulaw[s1&0xff]; + s2 = c219->mulaw[s2&0xff]; } else {