aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-04-16 12:58:14 +0000
committerFilippos Karapetis2010-04-16 12:58:14 +0000
commitdd6fbd887d86aa36bc1dbc13623f72b20ce9f840 (patch)
treeb0a8642dc8d1d67afdba3020030b8bc840c9252d
parent09a01c71ddd7843cd6ba5883aeb3be1863d24dff (diff)
downloadscummvm-rg350-dd6fbd887d86aa36bc1dbc13623f72b20ce9f840.tar.gz
scummvm-rg350-dd6fbd887d86aa36bc1dbc13623f72b20ce9f840.tar.bz2
scummvm-rg350-dd6fbd887d86aa36bc1dbc13623f72b20ce9f840.zip
Added a sanity check for the current list node inside GfxAnimate::invoke(). This should fix the crash in LSL2 as described in patch #2987942, without adding additional lookups
svn-id: r48670
-rw-r--r--engines/sci/graphics/animate.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp
index 67c41ee9ba..7550e855bf 100644
--- a/engines/sci/graphics/animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -99,8 +99,11 @@ bool GfxAnimate::invoke(List *list, int argc, reg_t *argv) {
// Lookup node again, since the nodetable it was in may have been reallocated
curNode = _s->_segMan->lookupNode(curAddress);
}
- curAddress = curNode->succ;
- curNode = _s->_segMan->lookupNode(curAddress);
+
+ if (curNode) {
+ curAddress = curNode->succ;
+ curNode = _s->_segMan->lookupNode(curAddress);
+ }
}
return true;
}