[Scummvm-git-logs] scummvm master -> a07e44d7f66bca085c60ba3a6dc795c99203986b

orgads noreply at scummvm.org
Fri Aug 22 09:59:30 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:
a07e44d7f6 GOB: Fix potential out-of-bounds array access


Commit: a07e44d7f66bca085c60ba3a6dc795c99203986b
    https://github.com/scummvm/scummvm/commit/a07e44d7f66bca085c60ba3a6dc795c99203986b
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2025-08-22T12:59:08+03:00

Commit Message:
GOB: Fix potential out-of-bounds array access

engines/gob/hotspots.cpp: In member function 'void Gob::Hotspots::expandHotspotText(uint16)':
engines/gob/hotspots.cpp:2443:72: warning: array subscript 256 is above array bounds of 'Gob::Draw::fascinWin [10]' [-Warray-bounds=]
 2443 |                 if (windowNum != 0 && (_vm->_draw->_fascinWin[windowNum].id == -1 ||
      |                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from C:/Projects/scummvm/engines/gob/hotspots.cpp:32:
engines/gob/draw.h:180:19: note: while referencing 'Gob::Draw::_fascinWin'
  180 |         fascinWin _fascinWin[10];
      |                   ^~~~~~~~~~

Changed paths:
    engines/gob/hotspots.cpp


diff --git a/engines/gob/hotspots.cpp b/engines/gob/hotspots.cpp
index 0412462c7a3..52d49f4eee4 100644
--- a/engines/gob/hotspots.cpp
+++ b/engines/gob/hotspots.cpp
@@ -2440,7 +2440,7 @@ void Hotspots::expandHotspotText(uint16 spotID) {
 	if (_vm->getGameType() == kGameTypeFascination) {
 		// Don't include hotspots that aren't on the current window
 		uint16 windowNum = _hotspots[spotID].getWindow();
-		if (windowNum != 0 && (_vm->_draw->_fascinWin[windowNum].id == -1 || 
+		if (windowNum != 0 && windowNum < 10 && (_vm->_draw->_fascinWin[windowNum].id == -1 ||
 							_vm->_draw->_fascinWin[windowNum].id != _vm->_draw->_winCount - 1)) {
 			return;
 		}




More information about the Scummvm-git-logs mailing list