aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/sound
diff options
context:
space:
mode:
authorSven Hesse2013-04-15 18:42:46 +0200
committerSven Hesse2013-04-15 18:42:46 +0200
commitbbe4372f5b05e02b86b4609bf24b49f24f33a866 (patch)
tree6be22779645bdfd588ee35da707f07d15b7c5abb /engines/gob/sound
parent2a1308b4e1e6c4d1fe71f70d2452fbb5b249edf2 (diff)
downloadscummvm-rg350-bbe4372f5b05e02b86b4609bf24b49f24f33a866.tar.gz
scummvm-rg350-bbe4372f5b05e02b86b4609bf24b49f24f33a866.tar.bz2
scummvm-rg350-bbe4372f5b05e02b86b4609bf24b49f24f33a866.zip
GOB: Add another sanity check
Diffstat (limited to 'engines/gob/sound')
-rw-r--r--engines/gob/sound/adlib.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index d9fc362547..2bf7f266a1 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -375,8 +375,10 @@ void AdLib::setVoiceTimbre(uint8 voice, const uint16 *params) {
const int voicePerc = voice - kVoiceBaseDrum;
if (!isPercussionMode() || (voice < kVoiceBaseDrum)) {
- setOperatorParams(kVoiceMelodyOperator[0][voice], params0, waves[0]);
- setOperatorParams(kVoiceMelodyOperator[1][voice], params1, waves[1]);
+ if (voice < kMelodyVoiceCount) {
+ setOperatorParams(kVoiceMelodyOperator[0][voice], params0, waves[0]);
+ setOperatorParams(kVoiceMelodyOperator[1][voice], params1, waves[1]);
+ }
} else if (voice == kVoiceBaseDrum) {
setOperatorParams(kVoicePercussionOperator[0][voicePerc], params0, waves[0]);
setOperatorParams(kVoicePercussionOperator[1][voicePerc], params1, waves[1]);