From 0057d9b9b2c935cd1b49b05fe78c017868167432 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 6 Jun 2009 17:48:30 +0000 Subject: Add guard check to set.key opcode. svn-id: r41260 --- engines/agi/op_cmd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 98351daf4b..a620788de2 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1406,6 +1406,11 @@ cmd(set_cursor_char) { cmd(set_key) { int key; + if (game.lastController >= MAX_CONTROLLERS) { + warning("Number of set.keys exceeded %d", MAX_CONTROLLERS); + return; + } + debugC(4, kDebugLevelScripts, "%d %d %d", p0, p1, p2); key = 256 * p1 + p0; -- cgit v1.2.3