[Scummvm-git-logs] scummvm master -> 3c619a858d9dca1ec480e3c7776adffcff12224b

kelmer44 noreply at scummvm.org
Sat Oct 4 16:47:22 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:
3c619a858d TOT: Fixes possible (but unlikely) out-of-bounds reports from Coverity


Commit: 3c619a858d9dca1ec480e3c7776adffcff12224b
    https://github.com/scummvm/scummvm/commit/3c619a858d9dca1ec480e3c7776adffcff12224b
Author: kelmer (kelmer at gmail.com)
Date: 2025-10-04T18:47:14+02:00

Commit Message:
TOT: Fixes possible (but unlikely) out-of-bounds reports from Coverity

Changed paths:
    engines/tot/dialog.cpp
    engines/tot/engine.cpp


diff --git a/engines/tot/dialog.cpp b/engines/tot/dialog.cpp
index 7d65d4038f9..3cc2fadeed1 100644
--- a/engines/tot/dialog.cpp
+++ b/engines/tot/dialog.cpp
@@ -438,7 +438,7 @@ void talk(byte characterIndex) {
 		Common::List<uint> *linkedList = findDialogue(tree, characterIndex);
 		byte conversationIndex = 0;
 		l1 = linkedList->begin();
-		while (l1 != linkedList->end() && !g_engine->shouldQuit()) {
+		while (l1 != linkedList->end() && !g_engine->shouldQuit() && conversationIndex < 15) {
 			g_engine->_verbFile.seek(kVerbRegSize * (*l1));
 			conversationIndex += 1;
 			text = g_engine->readTextRegister();
diff --git a/engines/tot/engine.cpp b/engines/tot/engine.cpp
index 11bc5e2beeb..21cf3f790bc 100644
--- a/engines/tot/engine.cpp
+++ b/engines/tot/engine.cpp
@@ -3293,7 +3293,7 @@ void TotEngine::openScreenObject() {
 				animatePickup1(0, 1);
 				clearScreenLayer(_curObject.depth - 1);
 				yIndex = 0;
-				while (_currentRoomData->screenLayers[yIndex].depth != _curObject.depth && yIndex != 15) {
+				while (_currentRoomData->screenLayers[yIndex].depth != _curObject.depth && yIndex < 14) {
 					yIndex++;
 				}
 				debug("changing bitmap at %d, with depth = %d", yIndex, _currentRoomData->screenLayers[yIndex].depth);




More information about the Scummvm-git-logs mailing list