aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-06-07 12:13:30 +0200
committerStrangerke2014-06-07 12:13:30 +0200
commit52bcc9dd25e43321ddc662e8dc3fa9c1a87c9542 (patch)
treed2f0c279d2e90deee254685845a12f00c8b3b61f
parent701f7d5707f0415a4469eba4d2f30cb2daf7e570 (diff)
downloadscummvm-rg350-52bcc9dd25e43321ddc662e8dc3fa9c1a87c9542.tar.gz
scummvm-rg350-52bcc9dd25e43321ddc662e8dc3fa9c1a87c9542.tar.bz2
scummvm-rg350-52bcc9dd25e43321ddc662e8dc3fa9c1a87c9542.zip
CRUISE: Fix a null pointer dereference
-rw-r--r--engines/cruise/cruise_main.cpp6
1 files 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) {