diff options
author | Filippos Karapetis | 2010-07-22 17:53:32 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-07-22 17:53:32 +0000 |
commit | 91e909a25cf056dba37eb6a68bd9ba957cd18175 (patch) | |
tree | 2888589a55ce651f80918db4746903662edcf9b2 | |
parent | b4a704c342929c5739a56d35b4035b24330380d0 (diff) | |
download | scummvm-rg350-91e909a25cf056dba37eb6a68bd9ba957cd18175.tar.gz scummvm-rg350-91e909a25cf056dba37eb6a68bd9ba957cd18175.tar.bz2 scummvm-rg350-91e909a25cf056dba37eb6a68bd9ba957cd18175.zip |
SCI: Added a sanity check for rev 51152. If a node has been deleted, it shouldn't have a successor node
svn-id: r51154
-rw-r--r-- | engines/sci/graphics/animate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index d95125e0a8..229d38c777 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -91,6 +91,8 @@ bool GfxAnimate::invoke(List *list, int argc, reg_t *argv) { signal = readSelectorValue(_s->_segMan, curObject, SELECTOR(signal)); if (!(signal & kSignalFrozen)) { + reg_t nextNode = curNode->succ; + // Call .doit method of that object invokeSelector(_s, curObject, SELECTOR(doit), argc, argv, 0); @@ -102,6 +104,10 @@ bool GfxAnimate::invoke(List *list, int argc, reg_t *argv) { // The node might have been deallocated at this point (e.g. LSL2, room 42), // in which case the node reference will be null and the loop will stop below. curNode = _s->_segMan->lookupNode(curAddress, false); + + // Sanity check: If the node has been deleted, it shouldn't have a successor node + if (!curNode && !nextNode.isNull()) + error("kAnimate: list node has been deleted, but it has a successor node"); } if (curNode) { |