aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_sound.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2017-07-01 22:27:34 +0200
committerEugene Sandulenko2017-07-03 08:50:10 +0200
commit39b0d53bb583c49e64ed727ac27e4c2592302ba2 (patch)
tree0eeda3452d87ec3137127a53371829c4b758a2aa /engines/mohawk/riven_sound.cpp
parent006dcf6a74e3010d5d453cd8175680a72c81528e (diff)
downloadscummvm-rg350-39b0d53bb583c49e64ed727ac27e4c2592302ba2.tar.gz
scummvm-rg350-39b0d53bb583c49e64ed727ac27e4c2592302ba2.tar.bz2
scummvm-rg350-39b0d53bb583c49e64ed727ac27e4c2592302ba2.zip
MOHAWK: Fix incorrect loop in sound manager
Diffstat (limited to 'engines/mohawk/riven_sound.cpp')
-rw-r--r--engines/mohawk/riven_sound.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/mohawk/riven_sound.cpp b/engines/mohawk/riven_sound.cpp
index 36dbab67bb..20ba353863 100644
--- a/engines/mohawk/riven_sound.cpp
+++ b/engines/mohawk/riven_sound.cpp
@@ -150,7 +150,7 @@ void RivenSoundManager::addAmbientSounds(const SLSTRecord &record) {
}
void RivenSoundManager::setTargetVolumes(const SLSTRecord &record) {
- for (uint i = 0; i < record.volumes.size(); i++) {
+ for (uint i = 0; i < MIN(_ambientSounds.sounds.size(), record.volumes.size()); i++) {
_ambientSounds.sounds[i].targetVolume = record.volumes[i] * record.globalVolume / 256;
_ambientSounds.sounds[i].targetBalance = record.balances[i];
}