From f3ca535038a50a4a98c1fb698cddc0a7f9cf1d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Boutonn=C3=A9?= Date: Fri, 1 Jan 2010 21:18:19 +0000 Subject: [PATCH] Fix a buffer overflow, thanks to syke svn-id: r46851 --- engines/gob/sound/adlib.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/gob/sound/adlib.cpp b/engines/gob/sound/adlib.cpp index 03bc87fb889..1f1851e3876 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