From 5e599dfb6e9101cd1cbafa280ed7ecf6a52a58bc Mon Sep 17 00:00:00 2001 From: a/ Date: Sat, 19 Jun 2021 18:26:04 +0900 Subject: [PATCH] SAGA2: Fix unsafe world access on objObscured --- engines/saga2/objects.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engines/saga2/objects.cpp b/engines/saga2/objects.cpp index 6dad9fc545d..431a6ad0dce 100644 --- a/engines/saga2/objects.cpp +++ b/engines/saga2/objects.cpp @@ -4356,11 +4356,15 @@ bool objObscured(GameObject *testObj) { bool obscured = false; if (isObject(testObj)) { + debug(3, "STUB: objObscured"); Point16 drawPos, org; ObjectSpriteInfo objSprInfo; ColorTable objColors; ProtoObj *proto = testObj->proto(); + ObjectID parent = testObj->_data.parentID; + if (isWorld(parent) == false) + return false; // Calculate X, Y coordinates of the sprite TileToScreenCoords(testObj->getLocation(), drawPos);