diff options
author | Travis Howell | 2005-04-16 05:36:01 +0000 |
---|---|---|
committer | Travis Howell | 2005-04-16 05:36:01 +0000 |
commit | a9ff09b06602082086207971f8c5d24ec30fe664 (patch) | |
tree | 2aaef943b6361f2b43411913f4f985a7cf2eb313 /scumm | |
parent | 2b6bdb6119679cef4354ad25fb1111eee268fa45 (diff) | |
download | scummvm-rg350-a9ff09b06602082086207971f8c5d24ec30fe664.tar.gz scummvm-rg350-a9ff09b06602082086207971f8c5d24ec30fe664.tar.bz2 scummvm-rg350-a9ff09b06602082086207971f8c5d24ec30fe664.zip |
Adjust for footdemo, which triggers assert.
svn-id: r17612
Diffstat (limited to 'scumm')
-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); } |