From 67b2866165abca2dfb0848105127655c54d474e3 Mon Sep 17 00:00:00 2001 From: dinkc64 <12570148+dinkc64@users.noreply.github.com> Date: Sat, 18 Oct 2014 13:40:17 +0000 Subject: [PATCH] stupid crash-fix for mystic warriors. something else is the real issue though. --- src/burn/snd/k054539.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/burn/snd/k054539.cpp b/src/burn/snd/k054539.cpp index 5b0230ba0..66600050a 100644 --- a/src/burn/snd/k054539.cpp +++ b/src/burn/snd/k054539.cpp @@ -481,6 +481,9 @@ else cur_pos += (pdelta * nUpdateStep) >> 15; cur_pval = cur_val; + if (cur_pos > info->rom_size) { + continue; + } cur_val = (INT16)(samples[cur_pos] << 8); if(cur_val == (INT16)0x8000) { if(base2[1] & 1) { @@ -509,6 +512,9 @@ else cur_pos += (pdelta * nUpdateStep) >> 15; cur_pval = cur_val; + if (cur_pos+1 > info->rom_size) { + continue; + } cur_val = (INT16)(samples[cur_pos] | samples[cur_pos+1]<<8); if(cur_val == (INT16)0x8000) { if(base2[1] & 1) {