aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-10-03 14:24:28 +0000
committerTravis Howell2004-10-03 14:24:28 +0000
commit80fd0d75f304fe17ec4ad7784ef5b749f1caf76d (patch)
tree2152e8801ef3ac89795f80a8f7cd018be4222713 /scumm
parent3aadf745f918b98d39228a86613d3e7740bb20a1 (diff)
downloadscummvm-rg350-80fd0d75f304fe17ec4ad7784ef5b749f1caf76d.tar.gz
scummvm-rg350-80fd0d75f304fe17ec4ad7784ef5b749f1caf76d.tar.bz2
scummvm-rg350-80fd0d75f304fe17ec4ad7784ef5b749f1caf76d.zip
Add safety check.
svn-id: r15392
Diffstat (limited to 'scumm')
-rw-r--r--scumm/script_v72he.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index a31c8ae089..c8b73c8fda 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -2412,7 +2412,7 @@ void ScummEngine_v72he::o72_unknownF6() {
}
void ScummEngine_v72he::o72_getResourceSize() {
- int size, type;
+ int size = 0, type;
int idx = pop();
byte subOp = fetchScriptByte();
@@ -2443,7 +2443,8 @@ void ScummEngine_v72he::o72_getResourceSize() {
}
const byte *ptr = getResourceAddress(type, idx);
- size = READ_BE_UINT32(ptr + 4) - 8;
+ if (ptr)
+ size = READ_BE_UINT32(ptr + 4) - 8;
push(size);
}