aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-11 00:36:03 +0200
committerJohannes Schickel2011-04-11 00:36:03 +0200
commitd9441aeb802cd99cbef7f392301ff77e625a4f94 (patch)
tree11a2bbab3b18777a702989b621b00e4521daa408 /engines/kyra
parent073da68efa75045530afd201e8b82886326072a9 (diff)
downloadscummvm-rg350-d9441aeb802cd99cbef7f392301ff77e625a4f94.tar.gz
scummvm-rg350-d9441aeb802cd99cbef7f392301ff77e625a4f94.tar.bz2
scummvm-rg350-d9441aeb802cd99cbef7f392301ff77e625a4f94.zip
KYRA: Add some assertion to prevent out of bounds access.
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/lol.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index bec4879f36..5928c40f92 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -899,6 +899,8 @@ void LoLEngine::startupNew() {
memset(_globalScriptVars2, 0x100, 8);
static const int selectIds[] = { -9, -1, -8, -5 };
+ assert(_charSelection >= 0);
+ assert(_charSelection < ARRAYSIZE(selectIds));
addCharacter(selectIds[_charSelection]);
gui_enableDefaultPlayfieldButtons();