aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorFilippos Karapetis2010-02-06 16:12:19 +0000
committerFilippos Karapetis2010-02-06 16:12:19 +0000
commit788f375703892dae18d9f01bbda2d18f5881d1f7 (patch)
treed12950b4ab96fab71bbb4ba27c4fb8c50dd6f195 /engines/sci/engine
parentb12437bbfcf22def9d2e20b3fc95fd76dd47636b (diff)
downloadscummvm-rg350-788f375703892dae18d9f01bbda2d18f5881d1f7.tar.gz
scummvm-rg350-788f375703892dae18d9f01bbda2d18f5881d1f7.tar.bz2
scummvm-rg350-788f375703892dae18d9f01bbda2d18f5881d1f7.zip
Added a sanity check for kListAt and made the hack for displaying text work in SCI2 only
svn-id: r47931
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/klists.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 37f60d2830..9a63b39f18 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -473,6 +473,10 @@ reg_t kListAt(EngineState *s, int argc, reg_t *argv) {
List *list = s->_segMan->lookupList(argv[0]);
reg_t curAddress = list->first;
+ if (list->first.isNull()) {
+ warning("kListAt tried to reference empty list (%04x:%04x)", PRINT_REG(argv[0]));
+ return NULL_REG;
+ }
Node *curNode = s->_segMan->lookupNode(curAddress);
reg_t curObject = curNode->value;
int16 listIndex = argv[1].toUint16();