aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}