diff options
-rw-r--r-- | scumm/sprite_he.cpp | 7 | ||||
-rw-r--r-- | scumm/wiz_he.cpp | 12 |
2 files changed, 10 insertions, 9 deletions
diff --git a/scumm/sprite_he.cpp b/scumm/sprite_he.cpp index 08b99b49eb..a2b4c907b6 100644 --- a/scumm/sprite_he.cpp +++ b/scumm/sprite_he.cpp @@ -314,7 +314,12 @@ int ScummEngine_v90he::spriteInfoGet_field_88(int spriteId, int type) { void ScummEngine_v90he::getSpriteImageDim(int spriteId, int32 &w, int32 &h) { checkRange(_varNumSprites, 1, spriteId, "Invalid sprite %d"); - getWizImageDim(_spriteTable[spriteId].res_id, _spriteTable[spriteId].res_state, w, h); + if (_spriteTable[spriteId].res_id) { + getWizImageDim(_spriteTable[spriteId].res_id, _spriteTable[spriteId].res_state, w, h); + } else { + w = 0; + h = 0; + } } void ScummEngine_v90he::spriteInfoGet_tx_ty(int spriteId, int32 &tx, int32 &ty) { diff --git a/scumm/wiz_he.cpp b/scumm/wiz_he.cpp index 78e18f2e00..a7b6f75e7f 100644 --- a/scumm/wiz_he.cpp +++ b/scumm/wiz_he.cpp @@ -843,14 +843,10 @@ void ScummEngine_v72he::displayWizImage(const WizImage *pwi) { void ScummEngine_v72he::getWizImageDim(int resnum, int state, int32 &w, int32 &h) { const uint8 *dataPtr = getResourceAddress(rtImage, resnum); - if (dataPtr) { - const uint8 *wizh = findWrappedBlock(MKID('WIZH'), dataPtr, state, 0); - w = READ_LE_UINT32(wizh + 0x4); - h = READ_LE_UINT32(wizh + 0x8); - } else { - w = 0; - h = 0; - } + assert(dataPtr); + const uint8 *wizh = findWrappedBlock(MKID('WIZH'), dataPtr, state, 0); + w = READ_LE_UINT32(wizh + 0x4); + h = READ_LE_UINT32(wizh + 0x8); } uint8 *ScummEngine_v72he::drawWizImage(int restype, const WizImage *pwi) { |