From 9d10a998ae83f37eafef524cf1b750923f48cfad Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Wed, 29 Nov 2017 23:40:33 -0600 Subject: 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). --- engines/scumm/actor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.3