[Scummvm-cvs-logs] CVS: scummvm/scumm sprite_he.cpp,1.64,1.65 wiz_he.cpp,2.7,2.8
kirben
kirben at users.sourceforge.net
Fri Feb 25 20:57:10 CET 2005
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.368,2.369 script_v100he.cpp,2.66,2.67 script_v90he.cpp,2.161,2.162 sprite_he.cpp,1.63,1.64
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm sprite_he.cpp,1.65,1.66 sprite_he.h,1.15,1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14235/scumm
Modified Files:
sprite_he.cpp wiz_he.cpp
Log Message:
Catch all invalid image resource reads
Index: sprite_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sprite_he.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- sprite_he.cpp 26 Feb 2005 04:20:47 -0000 1.64
+++ sprite_he.cpp 26 Feb 2005 04:53:43 -0000 1.65
@@ -314,7 +314,12 @@
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) {
Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.7
retrieving revision 2.8
diff -u -d -r2.7 -r2.8
--- wiz_he.cpp 26 Feb 2005 00:35:23 -0000 2.7
+++ wiz_he.cpp 26 Feb 2005 04:53:43 -0000 2.8
@@ -843,14 +843,10 @@
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) {
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm intern.h,2.368,2.369 script_v100he.cpp,2.66,2.67 script_v90he.cpp,2.161,2.162 sprite_he.cpp,1.63,1.64
- Next message: [Scummvm-cvs-logs] CVS: scummvm/scumm sprite_he.cpp,1.65,1.66 sprite_he.h,1.15,1.16
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list