Fix crash when a PICT has no bounds resource

This commit is contained in:
elasota
2020-01-23 22:27:51 -05:00
parent 556a395e4a
commit fd48ca0a62

View File

@@ -908,9 +908,6 @@ short GetOriginalBounding (short theID)
short boundCode; short boundCode;
boundsRes = LoadHouseResource('bnds', theID).StaticCast<boundsType>(); boundsRes = LoadHouseResource('bnds', theID).StaticCast<boundsType>();
if (boundsRes.MMBlock()->m_size != sizeof(boundsType))
return 0; // Corrupted resource
if (boundsRes == nil) if (boundsRes == nil)
{ {
if (PictIDExists(theID)) if (PictIDExists(theID))
@@ -919,6 +916,9 @@ short GetOriginalBounding (short theID)
} }
else else
{ {
if (boundsRes.MMBlock()->m_size != sizeof(boundsType))
return 0; // Corrupted resource
boundCode = 0; boundCode = 0;
if ((*boundsRes)->left) if ((*boundsRes)->left)
boundCode += 1; boundCode += 1;