aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
Diffstat (limited to 'scumm')
-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) {