aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2014-05-04 03:48:36 +0300
committerFilippos Karapetis2014-05-04 03:48:36 +0300
commitf9b52398bdd621d4466a845c6d49f9f27e7a4482 (patch)
tree711447a0acf6d5b7960b9f4eeff1fbdb8aeb1203
parentd38e1aa5006266dedf5e7de6382df8c321009ee7 (diff)
downloadscummvm-rg350-f9b52398bdd621d4466a845c6d49f9f27e7a4482.tar.gz
scummvm-rg350-f9b52398bdd621d4466a845c6d49f9f27e7a4482.tar.bz2
scummvm-rg350-f9b52398bdd621d4466a845c6d49f9f27e7a4482.zip
MADS: Add a sanity check in DynamicHotspots::remove()
Fixes a crash when loading outside the hut
-rw-r--r--engines/mads/hotspots.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp
index 560726bda6..0853f66eac 100644
--- a/engines/mads/hotspots.cpp
+++ b/engines/mads/hotspots.cpp
@@ -97,7 +97,7 @@ int DynamicHotspots::setCursor(int index, CursorType cursor) {
void DynamicHotspots::remove(int index) {
Scene &scene = _vm->_game->_scene;
- if (_entries[index]._active) {
+ if (index >= 0 && _entries[index]._active) {
if (_entries[index]._seqIndex >= 0)
scene._sequences[_entries[index]._seqIndex]._dynamicHotspotIndex = -1;
_entries[index]._active = false;