mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-29 14:42:26 +00:00
Add more safety checks.
svn-id: r16939
This commit is contained in:
parent
72efd4c50e
commit
cf0aac1506
@ -598,8 +598,8 @@ const byte *ScummEngine_v72he::findWrappedBlock(uint32 tag, const byte *ptr, int
|
||||
return NULL;
|
||||
|
||||
size = getResourceDataSize(offs) / 4;
|
||||
if ((uint32)state >= (uint32)size)
|
||||
return NULL;
|
||||
assert((uint32)state <= (uint32)size);
|
||||
|
||||
|
||||
offs += READ_LE_UINT32(offs + state * sizeof(uint32));
|
||||
offs = findResourceData(tag, offs - 8);
|
||||
|
@ -845,6 +845,7 @@ void ScummEngine_v72he::getWizImageDim(int resnum, int state, int32 &w, int32 &h
|
||||
const uint8 *dataPtr = getResourceAddress(rtImage, resnum);
|
||||
assert(dataPtr);
|
||||
const uint8 *wizh = findWrappedBlock(MKID('WIZH'), dataPtr, state, 0);
|
||||
assert(wizh);
|
||||
w = READ_LE_UINT32(wizh + 0x4);
|
||||
h = READ_LE_UINT32(wizh + 0x8);
|
||||
}
|
||||
@ -1311,10 +1312,10 @@ void ScummEngine_v90he::processWizImage(const WizParameters *params) {
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
warning("unhandled processWizImage mode %d", params->processMode);
|
||||
warning("Unhandled processWizImage mode %d", params->processMode);
|
||||
break;
|
||||
default:
|
||||
warning("invalid processWizImage mode %d", params->processMode);
|
||||
debug(1, "Invalid processWizImage mode %d", params->processMode);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user