From f279cc0e514f0b521a43604be66de945f060c528 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sat, 20 Apr 2013 16:47:48 +0200 Subject: SCI: Add extra sanity check --- engines/sci/engine/klists.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/sci') 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; -- cgit v1.2.3