[Scummvm-git-logs] scummvm master -> b2233f83e2c2d850cb42f7a3466a8c4391d20693
sev-
sev at scummvm.org
Fri Nov 29 17:39:48 UTC 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b2233f83e2 DIRECTOR: LINGO: Add sanity checks to script execution
Commit: b2233f83e2c2d850cb42f7a3466a8c4391d20693
https://github.com/scummvm/scummvm/commit/b2233f83e2c2d850cb42f7a3466a8c4391d20693
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2019-11-29T18:38:46+01:00
Commit Message:
DIRECTOR: LINGO: Add sanity checks to script execution
Changed paths:
engines/director/lingo/lingo-codegen.cpp
diff --git a/engines/director/lingo/lingo-codegen.cpp b/engines/director/lingo/lingo-codegen.cpp
index 07f733f..2be8848 100644
--- a/engines/director/lingo/lingo-codegen.cpp
+++ b/engines/director/lingo/lingo-codegen.cpp
@@ -53,7 +53,7 @@
namespace Director {
void Lingo::execute(uint pc) {
- for(_pc = pc; (*_currentScript)[_pc] != STOP && !_returning;) {
+ for (_pc = pc; !_returning && (*_currentScript)[_pc] != STOP;) {
Common::String instr = decodeInstruction(_pc);
if (debugChannelSet(5, kDebugLingoExec))
@@ -66,6 +66,11 @@ void Lingo::execute(uint pc) {
if (debugChannelSet(5, kDebugLingoExec))
printStack("Stack after: ");
+
+ if (_pc >= (*_currentScript).size()) {
+ warning("Lingo::execute(): Bad PC (%d)", _pc);
+ break;
+ }
}
}
More information about the Scummvm-git-logs
mailing list