aboutsummaryrefslogtreecommitdiff
path: root/engines/cryo
diff options
context:
space:
mode:
authorRetro-Junk2017-01-25 00:30:31 +0300
committerEugene Sandulenko2017-01-25 22:42:26 +0100
commitaeeaf9b9e6bc430f17c0fd279b666ee55f80cece (patch)
tree3bbe002cd2fc86024d70c276b15ab8c6b1e25c08 /engines/cryo
parent7e4043ec8595cd083c4966cfa001958912071932 (diff)
downloadscummvm-rg350-aeeaf9b9e6bc430f17c0fd279b666ee55f80cece.tar.gz
scummvm-rg350-aeeaf9b9e6bc430f17c0fd279b666ee55f80cece.tar.bz2
scummvm-rg350-aeeaf9b9e6bc430f17c0fd279b666ee55f80cece.zip
CRYO: Fix crash during PC intro video
Diffstat (limited to 'engines/cryo')
-rw-r--r--engines/cryo/bugs.txt2
-rw-r--r--engines/cryo/eden.cpp6
-rw-r--r--engines/cryo/eden.h2
3 files changed, 6 insertions, 4 deletions
diff --git a/engines/cryo/bugs.txt b/engines/cryo/bugs.txt
index 5f3c47e0e4..a69538a449 100644
--- a/engines/cryo/bugs.txt
+++ b/engines/cryo/bugs.txt
@@ -16,4 +16,4 @@ E. Bogus hitbox in upper right corner of mirror screen (under mini-map)
F. Wrong frescoes cursor on PC
G. Junk on a valley entrance screen on PC
H. On PC, no sound during first Mungo's dialogue, memory corruption after that
-J. PC intro video is out of sync with background voice, crashes later
+J. PC intro video is lagging behind of background voice
diff --git a/engines/cryo/eden.cpp b/engines/cryo/eden.cpp
index bfee1a0d8f..06cd9022cf 100644
--- a/engines/cryo/eden.cpp
+++ b/engines/cryo/eden.cpp
@@ -5713,7 +5713,7 @@ void EdenGame::allocateBuffers() {
ALLOC(_glowBuffer, 0x2800, byte);
ALLOC(_gameFont, 0x900, byte);
ALLOC(_gameLipsync, 0x205C, byte);
- ALLOC(_musicBuf, 0x140000, byte);
+ ALLOC(_musicBuf, kMaxMusicSize, byte);
#undef ALLOC
}
@@ -6714,8 +6714,8 @@ int EdenGame::loadmusicfile(int16 num) {
int32 offs = file->_offs;
_bigfile.seek(offs, SEEK_SET);
int32 numread = size;
- if (numread > 0x140000) //TODO: const
- numread = 0x140000;
+ if (numread > kMaxMusicSize)
+ error("Music file %s is too big", file->_name);
_bigfile.read(_musicBuf, numread);
return size;
}
diff --git a/engines/cryo/eden.h b/engines/cryo/eden.h
index c05b3db1e0..edcfc860a7 100644
--- a/engines/cryo/eden.h
+++ b/engines/cryo/eden.h
@@ -735,6 +735,8 @@ private:
byte *_codePtr;
uint8 tab_2CB1E[8][4];
+
+ const unsigned int kMaxMusicSize = 2200000; // largest .mus file size
};
}