From fd48ca0a6226728f8fc264793fa8f038b5ffa5fd Mon Sep 17 00:00:00 2001 From: elasota Date: Thu, 23 Jan 2020 22:27:51 -0500 Subject: [PATCH] Fix crash when a PICT has no bounds resource --- GpApp/Room.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GpApp/Room.cpp b/GpApp/Room.cpp index e3b16ad..294a07b 100644 --- a/GpApp/Room.cpp +++ b/GpApp/Room.cpp @@ -908,9 +908,6 @@ short GetOriginalBounding (short theID) short boundCode; boundsRes = LoadHouseResource('bnds', theID).StaticCast(); - if (boundsRes.MMBlock()->m_size != sizeof(boundsType)) - return 0; // Corrupted resource - if (boundsRes == nil) { if (PictIDExists(theID)) @@ -919,6 +916,9 @@ short GetOriginalBounding (short theID) } else { + if (boundsRes.MMBlock()->m_size != sizeof(boundsType)) + return 0; // Corrupted resource + boundCode = 0; if ((*boundsRes)->left) boundCode += 1;