aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-09-12 07:01:46 +0000
committerTorbjörn Andersson2005-09-12 07:01:46 +0000
commitc16047815ff8d44a1011c1bda8441481223c3f6b (patch)
tree4c63623e4e2f7cd781d94ef860395478161fd7cb
parent42cc16e2cdf18d61f430f4d17c945649e0f27249 (diff)
downloadscummvm-rg350-c16047815ff8d44a1011c1bda8441481223c3f6b.tar.gz
scummvm-rg350-c16047815ff8d44a1011c1bda8441481223c3f6b.tar.bz2
scummvm-rg350-c16047815ff8d44a1011c1bda8441481223c3f6b.zip
Avoid integer overflow in volume parameter to playRaw(). This fixes bug
#1288081, the "missing" sound effects in the floppy intro. svn-id: r18811
-rw-r--r--sky/sound.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/sky/sound.cpp b/sky/sound.cpp
index c2f407b515..b091b18fce 100644
--- a/sky/sound.cpp
+++ b/sky/sound.cpp
@@ -1094,6 +1094,8 @@ void Sound::playSound(uint16 sound, uint16 volume, uint8 channel) {
}
volume = ((volume & 0x7F) + 1) << 1;
+ if (volume > 255)
+ volume = 255;
sound &= 0xFF;
// note: all those tables are big endian. Don't ask me why. *sigh*