aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-20 16:47:48 +0200
committerWillem Jan Palenstijn2013-04-20 23:53:06 +0200
commitf279cc0e514f0b521a43604be66de945f060c528 (patch)
treedc03b59b327fb464a0baa6ec08b7dcb330b7cb78 /engines/sci
parent3c94770349bbf094f6f82af3b603f7dbff15f6d0 (diff)
downloadscummvm-rg350-f279cc0e514f0b521a43604be66de945f060c528.tar.gz
scummvm-rg350-f279cc0e514f0b521a43604be66de945f060c528.tar.bz2
scummvm-rg350-f279cc0e514f0b521a43604be66de945f060c528.zip
SCI: Add extra sanity check
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/klists.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 342fa95eda..7e6c112b9f 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -801,7 +801,8 @@ reg_t kArray(EngineState *s, int argc, reg_t *argv) {
#endif
return NULL_REG;
}
- if (s->_segMan->getSegmentObj(argv[1].getSegment())->getType() != SEG_TYPE_ARRAY)
+ SegmentObj *sobj = s->_segMan->getSegmentObj(argv[1].getSegment());
+ if (!sobj || sobj->getType() != SEG_TYPE_ARRAY)
error("kArray(Dup): Request to duplicate a segment which isn't an array");
reg_t arrayHandle;