aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-04-16 05:36:01 +0000
committerTravis Howell2005-04-16 05:36:01 +0000
commita9ff09b06602082086207971f8c5d24ec30fe664 (patch)
tree2aaef943b6361f2b43411913f4f985a7cf2eb313
parent2b6bdb6119679cef4354ad25fb1111eee268fa45 (diff)
downloadscummvm-rg350-a9ff09b06602082086207971f8c5d24ec30fe664.tar.gz
scummvm-rg350-a9ff09b06602082086207971f8c5d24ec30fe664.tar.bz2
scummvm-rg350-a9ff09b06602082086207971f8c5d24ec30fe664.zip
Adjust for footdemo, which triggers assert.
svn-id: r17612
-rw-r--r--scumm/script_v72he.cpp2
-rw-r--r--scumm/script_v80he.cpp9
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);
}