diff options
author | Filippos Karapetis | 2010-02-06 16:12:19 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-02-06 16:12:19 +0000 |
commit | 788f375703892dae18d9f01bbda2d18f5881d1f7 (patch) | |
tree | d12950b4ab96fab71bbb4ba27c4fb8c50dd6f195 /engines/sci/engine | |
parent | b12437bbfcf22def9d2e20b3fc95fd76dd47636b (diff) | |
download | scummvm-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.cpp | 4 |
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(); |