diff options
author | Strangerke | 2014-06-15 18:19:11 +0200 |
---|---|---|
committer | Strangerke | 2014-06-15 18:19:11 +0200 |
commit | 8dbfcc37fb69c890404c6bba38ae07d0e1040115 (patch) | |
tree | c6aae4cccb73db93f72de85bf1c1ea87fad2f39c /engines/cruise | |
parent | 9c4d086165e74d70439fe95992bc9e5c1a65cb25 (diff) | |
download | scummvm-rg350-8dbfcc37fb69c890404c6bba38ae07d0e1040115.tar.gz scummvm-rg350-8dbfcc37fb69c890404c6bba38ae07d0e1040115.tar.bz2 scummvm-rg350-8dbfcc37fb69c890404c6bba38ae07d0e1040115.zip |
CRUISE: Add a safeguard to avoid a potential null pointer derefenrece
Diffstat (limited to 'engines/cruise')
-rw-r--r-- | engines/cruise/cruise_main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 2de8d273f7..0ad1416df2 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -934,8 +934,11 @@ bool createDialog(int objOvl, int objIdx, int x, int y) { else color = -1; - ptr = getObjectName(ptrHead->obj1Number, ovl3->arrayNameObj); - addSelectableMenuEntry(j, i, menuTable[0], 1, color, ptr); + if (ovl3) { + ptr = getObjectName(ptrHead->obj1Number, ovl3->arrayNameObj); + addSelectableMenuEntry(j, i, menuTable[0], 1, color, ptr); + } else + error("Unexpected null pointer in createDialog()"); } } } |