aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorColin Snover2017-11-29 23:40:33 -0600
committerEugene Sandulenko2018-01-31 17:56:33 +0100
commit9d10a998ae83f37eafef524cf1b750923f48cfad (patch)
tree4612c3a644cec3dc9fb32f8c77c4f5e33154dacf /engines/scumm
parentb166746b9c698e7550f64c418ef18dc91a951ce2 (diff)
downloadscummvm-rg350-9d10a998ae83f37eafef524cf1b750923f48cfad.tar.gz
scummvm-rg350-9d10a998ae83f37eafef524cf1b750923f48cfad.tar.bz2
scummvm-rg350-9d10a998ae83f37eafef524cf1b750923f48cfad.zip
SCUMM: Fix stack overflow initializing locals
This happens when clicking on the triangular button in room 27 in The Dig. There are probably several other places where this overflow happens, since there are several different `int args[16]` in the code (and many more `int args[` of various sizes, not all of which are at least NUM_SCRIPT_LOCAL).
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/actor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index aa94300041..66a7d90b42 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -768,7 +768,7 @@ void Actor::startWalkAnim(int cmd, int angle) {
* work as usual
*/
if (_walkScript) {
- int args[16];
+ int args[NUM_SCRIPT_LOCAL];
memset(args, 0, sizeof(args));
args[0] = _number;
args[1] = cmd;