aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorArnaud Boutonné2010-01-01 21:18:19 +0000
committerArnaud Boutonné2010-01-01 21:18:19 +0000
commitf3ca535038a50a4a98c1fb698cddc0a7f9cf1d64 (patch)
tree29a20349a4e9eefaa3e3260b711d75006eaa6b34 /engines/gob
parent379ae6df30b1014f2c6aa772d142d007ab4edffe (diff)
downloadscummvm-rg350-f3ca535038a50a4a98c1fb698cddc0a7f9cf1d64.tar.gz
scummvm-rg350-f3ca535038a50a4a98c1fb698cddc0a7f9cf1d64.tar.bz2
scummvm-rg350-f3ca535038a50a4a98c1fb698cddc0a7f9cf1d64.zip
Fix a buffer overflow, thanks to syke
svn-id: r46851
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/sound/adlib.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp
index 03bc87fb88..1f1851e387 100644
--- a/engines/gob/sound/adlib.cpp
+++ b/engines/gob/sound/adlib.cpp
@@ -247,7 +247,7 @@ void AdLib::setKey(byte voice, byte note, bool on, bool spec) {
}
void AdLib::setVolume(byte voice, byte volume) {
- volume = 0x3F - (volume * 0x7E + 0x7F) / 0xFE;
+ volume = 0x3F - ((volume * 0x7E) + 0x7F) / 0xFE;
writeOPL(0x40 + _volRegNums[voice], volume);
}
@@ -598,7 +598,7 @@ void MDYPlayer::interpret() {
uint8 timbre;
if (_first) {
- for (int i = 0; i < 11; i ++)
+ for (int i = 0; i < 9; i ++)
setVolume(i, 0);
// TODO : Set pitch range