aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorDavid Turner2010-03-31 03:19:01 +0000
committerDavid Turner2010-03-31 03:19:01 +0000
commit1fb60b4990b5b19e091c255f758288164b760272 (patch)
tree158da46363428b70af799ddb6990eac0860c43f8 /engines/draci
parent1d2122d466801e36406aad80fe56f4349fa1ddaa (diff)
downloadscummvm-rg350-1fb60b4990b5b19e091c255f758288164b760272.tar.gz
scummvm-rg350-1fb60b4990b5b19e091c255f758288164b760272.tar.bz2
scummvm-rg350-1fb60b4990b5b19e091c255f758288164b760272.zip
Basic correction for bug #2976774 "DRACI: Segfault Crash When Leaving Inventory".
This patch corrects the valgrind fault, but may not be the ultimate fix. This should be reviewed before backport to v1.1.0 branch. svn-id: r48434
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/game.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index d52c78061e..aedc3b9a87 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -332,7 +332,8 @@ void Game::handleInventoryLoop() {
// animation ID. In this way, we obtain its itemID.
if (_animUnderCursor != NULL && _animUnderCursor != _inventoryAnim && _animUnderCursor->getID() != kOverlayImage) {
_itemUnderCursor = getItem(kInventoryItemsID - _animUnderCursor->getID());
- assert(_itemUnderCursor->_anim == _animUnderCursor);
+ if (_itemUnderCursor != NULL)
+ assert(_itemUnderCursor->_anim == _animUnderCursor);
} else {
_itemUnderCursor = NULL;
}