From 52bcc9dd25e43321ddc662e8dc3fa9c1a87c9542 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Sat, 7 Jun 2014 12:13:30 +0200 Subject: CRUISE: Fix a null pointer dereference --- engines/cruise/cruise_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index c00f8a55ae..d7f5871d39 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -909,14 +909,14 @@ bool createDialog(int objOvl, int objIdx, int x, int y) { if (obj2Ovl > 0) ovl4 = overlayTable[obj2Ovl].ovlData; - if ((ovl3) && (ptrHead->obj1Number >= 0)) { + if (ovl3 && (ptrHead->obj1Number >= 0)) { testState1 = ptrHead->obj1OldState; } - if ((ovl4) && (ptrHead->obj2Number >= 0)) { + if (ovl4 && (ptrHead->obj2Number >= 0)) { testState2 = ptrHead->obj2OldState; } - if ((ovl4) && (ptrHead->verbNumber >= 0) && + if (ovl4 && ovl2 && (ptrHead->verbNumber >= 0) && ((testState1 == -1) || (testState1 == objectState2)) && ((testState2 == -1) || (testState2 == objectState))) { if (ovl2->nameVerbGlob) { -- cgit v1.2.3