From 80fd0d75f304fe17ec4ad7784ef5b749f1caf76d Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 3 Oct 2004 14:24:28 +0000 Subject: Add safety check. svn-id: r15392 --- scumm/script_v72he.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scumm') 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); } -- cgit v1.2.3