aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorEugene Sandulenko2009-06-06 17:48:30 +0000
committerEugene Sandulenko2009-06-06 17:48:30 +0000
commit0057d9b9b2c935cd1b49b05fe78c017868167432 (patch)
tree614f1bd387f294d97b533cb80d9f7de15ab79cfd /engines/agi
parentea3373708c6aaea0f04543b913883dbb74556f52 (diff)
downloadscummvm-rg350-0057d9b9b2c935cd1b49b05fe78c017868167432.tar.gz
scummvm-rg350-0057d9b9b2c935cd1b49b05fe78c017868167432.tar.bz2
scummvm-rg350-0057d9b9b2c935cd1b49b05fe78c017868167432.zip
Add guard check to set.key opcode.
svn-id: r41260
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/op_cmd.cpp5
1 files changed, 5 insertions, 0 deletions
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;