diff options
author | Colin Snover | 2017-11-29 23:40:33 -0600 |
---|---|---|
committer | Eugene Sandulenko | 2018-01-31 17:56:33 +0100 |
commit | 9d10a998ae83f37eafef524cf1b750923f48cfad (patch) | |
tree | 4612c3a644cec3dc9fb32f8c77c4f5e33154dacf | |
parent | b166746b9c698e7550f64c418ef18dc91a951ce2 (diff) | |
download | scummvm-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).
-rw-r--r-- | engines/scumm/actor.cpp | 2 |
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; |