aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-07-15 19:20:40 +0000
committerMax Horn2003-07-15 19:20:40 +0000
commitf60e8ff53e42efa564cdee5f5bc0e3d660e4b11b (patch)
treef78ac443782deb0bda8eed107bf97f7d797c3a49 /scumm
parent253e50b3e1f76476bb0c315154bc75fd9d13a2db (diff)
downloadscummvm-rg350-f60e8ff53e42efa564cdee5f5bc0e3d660e4b11b.tar.gz
scummvm-rg350-f60e8ff53e42efa564cdee5f5bc0e3d660e4b11b.tar.bz2
scummvm-rg350-f60e8ff53e42efa564cdee5f5bc0e3d660e4b11b.zip
fix for bug #771803
svn-id: r9043
Diffstat (limited to 'scumm')
-rw-r--r--scumm/boxes.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp
index 212fcaa965..6dba4bd827 100644
--- a/scumm/boxes.cpp
+++ b/scumm/boxes.cpp
@@ -238,9 +238,15 @@ Box *Scumm::getBoxBaseAddr(int box) {
// this also seems to be incorrect for atari st demo of zak
// and assumingly other v2 games
// The same happens in Indy3EGA (see bug #770351)
- if (_gameId == GID_MONKEY_EGA || _gameId == GID_INDY3) {
- if (box < 0 || box > ptr[0] - 1)
- warning("Illegal box %d", box);
+ // Also happend in ZakEGA (see bug #771803).
+ //
+ // This *might* mean that we have a bug in our box implementation
+ // OTOH, the original engine, unlike ScummVM, performed no bound
+ // checking at all. All the problems so far have been cases where
+ // the value was exactly one more than what we consider the maximum.
+ // So it's very well possible that all of these are script errors.
+ if (_gameId == GID_MONKEY_EGA || _gameId == GID_INDY3 || _gameId == GID_ZAK) {
+ checkRange(ptr[0], 0, box, "Illegal box %d");
} else
checkRange(ptr[0] - 1, 0, box, "Illegal box %d");