[Scummvm-git-logs] scummvm master -> 0561a8013b0793f50ce0e2f88e02b0fbfb3fcae6

sev- noreply at scummvm.org
Mon Sep 22 12:53:03 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
0561a8013b DIRECTOR: Add sanity check for behavior index


Commit: 0561a8013b0793f50ce0e2f88e02b0fbfb3fcae6
    https://github.com/scummvm/scummvm/commit/0561a8013b0793f50ce0e2f88e02b0fbfb3fcae6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-22T14:52:49+02:00

Commit Message:
DIRECTOR: Add sanity check for behavior index

Changed paths:
    engines/director/lingo/lingo-events.cpp


diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index ce90fc7866f..821984905aa 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -271,7 +271,10 @@ void Movie::resolveScriptEvent(LingoEvent &event) {
 			if (_vm->getVersion() >= 600) {
 				event.scriptType = kScoreScript;
 				event.scriptId = scriptId;
-				event.scriptInstance = _score->_channels[event.channelId]->_scriptInstanceList[event.behaviorIndex].u.obj;
+				if (event.behaviorIndex >= 0 && event.behaviorIndex < (int)_score->_channels[event.channelId]->_scriptInstanceList.size())
+					event.scriptInstance = _score->_channels[event.channelId]->_scriptInstanceList[event.behaviorIndex].u.obj;
+				else
+					warning("resolveScriptEvent: behaviorIndex %d out of range", event.behaviorIndex);
 				return;
 			}
 




More information about the Scummvm-git-logs mailing list