diff options
| -rw-r--r-- | scumm/script_v72he.cpp | 2 | ||||
| -rw-r--r-- | scumm/script_v80he.cpp | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 8159edf1bc..9bf5407209 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -2161,7 +2161,7 @@ void ScummEngine_v72he::o72_getResourceSize() { const byte *ptr = getResourceAddress(rtSound, resid); assert(ptr); - size = READ_BE_UINT32(ptr + 4) - 8; + size = getResourceDataSize(ptr); push(size); } diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp index 11a002c859..6156abf947 100644 --- a/scumm/script_v80he.cpp +++ b/scumm/script_v80he.cpp @@ -839,8 +839,13 @@ void ScummEngine_v80he::o80_getResourceSize() { } const byte *ptr = getResourceAddress(type, resid); - assert(ptr); - size = READ_BE_UINT32(ptr + 4) - 8; + if (ptr) { + size = getResourceDataSize(ptr); + } else { + debug(0, "o80_getResourceSize: invalid resource type %d id %d", type, resid); + size = 0; + } + push(size); } |
