aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorGregory Montoir2005-10-22 10:41:28 +0000
committerGregory Montoir2005-10-22 10:41:28 +0000
commite611a3ccb0f57d6da5049face2ee63fd5e8973a7 (patch)
tree9820b00d2b087af233df6c969d686550c17ea196 /scumm
parent6a911e65f0353fb3233236f0b17c4adf518cc24a (diff)
downloadscummvm-rg350-e611a3ccb0f57d6da5049face2ee63fd5e8973a7.tar.gz
scummvm-rg350-e611a3ccb0f57d6da5049face2ee63fd5e8973a7.tar.bz2
scummvm-rg350-e611a3ccb0f57d6da5049face2ee63fd5e8973a7.zip
This apparently fixes a crash in 'PuttPutt enters the Race'. Thanks Dark-Star. Also added some assert() calls.
svn-id: r19236
Diffstat (limited to 'scumm')
-rw-r--r--scumm/resource.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index 5309e713ba..01dce3cd75 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -484,11 +484,13 @@ void ScummEngine::readIndexBlock(uint32 blocktype, uint32 itemsize) {
// Names of rooms. Maybe we should put them into a table, for use by the debugger?
if (_heversion >= 80) {
for (int room; (room = _fileHandle->readUint16LE()); ) {
- char buf[20];
+ char buf[30];
i = 0;
for (byte s; (s = _fileHandle->readByte()); ) {
+ assert(i < ARRAYSIZE(buf));
buf[i++] = s;
}
+ assert(i < ARRAYSIZE(buf));
buf[i] = 0;
debug(5, "Room %d: '%s'", room, buf);
}