From 637f4b42ccb6f52f3c24d010d7d99b9cca1ec100 Mon Sep 17 00:00:00 2001 From: bladeoner Date: Mon, 5 Aug 2019 19:08:00 +0200 Subject: [PATCH] Snes9x - Fix out-of-bounds memory access. (#871) --- source/snes9x/apu/SPC_DSP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/snes9x/apu/SPC_DSP.cpp b/source/snes9x/apu/SPC_DSP.cpp index 0cd3c5f..9bba4fd 100644 --- a/source/snes9x/apu/SPC_DSP.cpp +++ b/source/snes9x/apu/SPC_DSP.cpp @@ -407,7 +407,7 @@ MISC_CLOCK( 30 ) inline VOICE_CLOCK( V1 ) { - m.t_dir_addr = m.t_dir * 0x100 + m.t_srcn * 4; + m.t_dir_addr = (m.t_dir * 0x100 + m.t_srcn * 4) & 0xffff; m.t_srcn = VREG(v->regs,srcn); } inline VOICE_CLOCK( V2 )