From d9441aeb802cd99cbef7f392301ff77e625a4f94 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 11 Apr 2011 00:36:03 +0200 Subject: KYRA: Add some assertion to prevent out of bounds access. --- engines/kyra/lol.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/kyra/lol.cpp') 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(); -- cgit v1.2.3