aboutsummaryrefslogtreecommitdiff
path: root/scumm/sound.cpp
diff options
context:
space:
mode:
authorJames Brown2003-01-29 04:00:45 +0000
committerJames Brown2003-01-29 04:00:45 +0000
commitafec98c6557a0d4c61c87107264c76d122087784 (patch)
treeac16d003a36586ae74703916c919c51f6ad01c90 /scumm/sound.cpp
parent0029c46754541fe6f997475199b4d3e3c7572c01 (diff)
downloadscummvm-rg350-afec98c6557a0d4c61c87107264c76d122087784.tar.gz
scummvm-rg350-afec98c6557a0d4c61c87107264c76d122087784.tar.bz2
scummvm-rg350-afec98c6557a0d4c61c87107264c76d122087784.zip
Stop the sound que stuff erroring(). This code was nasty, it LET itself write out of bounds -then- error()'ed. Youch.
There is still a problem, as this warning will come up quite frequently - leading me to believe the que is not being processed properly? svn-id: r6564
Diffstat (limited to 'scumm/sound.cpp')
-rw-r--r--scumm/sound.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 5d4282e5b8..5eec8ecb07 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -692,13 +692,17 @@ void Sound::soundKludge(int *list, int num) {
processSoundQues();
return;
}
+
+ if ((_soundQuePos + num) > 0x100) {
+ warning("Sound que buffer overflow");
+ return;
+ }
+
_soundQue[_soundQuePos++] = num;
- for (i = 0; i < num; i++)
+ for (i = 0; i < num; i++) {
_soundQue[_soundQuePos++] = list[i];
-
- if (_soundQuePos > 0x100)
- error("Sound que buffer overflow");
+ }
}
void Sound::talkSound(uint32 a, uint32 b, int mode, int frame) {