aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-07-22 10:10:56 +0200
committerStrangerke2013-07-22 10:10:56 +0200
commit6d2d0680a94dd47f55b94dcef8c40c1d06dd9f1d (patch)
tree8f08137c3f245eaa6c017e8e551ed895fcd4ec6f
parent624d05d7bce2c250016362f8af4cc27125ed67b8 (diff)
downloadscummvm-rg350-6d2d0680a94dd47f55b94dcef8c40c1d06dd9f1d.tar.gz
scummvm-rg350-6d2d0680a94dd47f55b94dcef8c40c1d06dd9f1d.tar.bz2
scummvm-rg350-6d2d0680a94dd47f55b94dcef8c40c1d06dd9f1d.zip
MORTEVIELLE: Fix some more invalid read sizes
-rw-r--r--engines/mortevielle/speech.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp
index 70b017c747..7fe8c54f2d 100644
--- a/engines/mortevielle/speech.cpp
+++ b/engines/mortevielle/speech.cpp
@@ -161,7 +161,7 @@ void SpeechManager::loadMusicSound() {
if (!f.open("sonmus.mor"))
error("Missing file - sonmus.mor");
- f.read(&_vm->_mem[kAdrCompMusicBuf1 * 16], 273);
+ f.read(&_vm->_mem[kAdrCompMusicBuf1 * 16], 273 * 128);
_vm->_soundManager.decodeMusic(&_vm->_mem[kAdrCompMusicBuf1 * 16], &_vm->_mem[kAdrNoise * 16], 273);
f.close();
@@ -177,7 +177,7 @@ void SpeechManager::loadPhonemeSounds() {
if (!f.open("phbrui.mor"))
error("Missing file - phbrui.mor");
- for (int i = 1; i <= 3; ++i)
+ for (int i = 1; i <= f.size() / 2; ++i)
_cfiphBuffer[i] = f.readSint16LE();
f.close();
@@ -194,10 +194,10 @@ void SpeechManager::loadNoise() {
if (!f.open("bruits")) //Translation: "noise"
error("Missing file - bruits");
- f.read(&_vm->_mem[kAdrNoise * 16], 250);
+ f.read(&_vm->_mem[kAdrNoise * 16], 250 * 128);
for (i = 0; i <= 19013; ++i)
_vm->_mem[(kAdrNoise * 16) + 32000 + i] = _vm->_mem[(kAdrNoise5 * 16) + i];
- f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149);
+ f.read(&_vm->_mem[(kAdrNoise1 * 16) + kOffsetB1], 149 * 128);
f.close();
}