[Scummvm-git-logs] scummvm master -> 56ae4e9ae7b707376f6b682d0d5939314a35d4fa

AndywinXp noreply at scummvm.org
Sun Apr 14 18:11:17 UTC 2024


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:
56ae4e9ae7 SCUMM: DIG: Fix #15067


Commit: 56ae4e9ae7b707376f6b682d0d5939314a35d4fa
    https://github.com/scummvm/scummvm/commit/56ae4e9ae7b707376f6b682d0d5939314a35d4fa
Author: AndywinXp (andywinxp at gmail.com)
Date: 2024-04-14T20:10:59+02:00

Commit Message:
SCUMM: DIG: Fix #15067

Changed paths:
    engines/scumm/charset.cpp


diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index ea0e1a89cf8..56825c064b2 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -1988,6 +1988,12 @@ int CharsetRendererV7::drawCharV7(byte *buffer, Common::Rect &clipRect, int x, i
 	int width = MIN(_origWidth, clipRect.right - x);
 	int height = MIN(_origHeight, clipRect.bottom - (y + _offsY));
 
+	// This can happen e.g. on The Dig (PT-BR version) during the credits in which
+	// the above calculation, done on character 0x80, results in a negative number;
+	// this could spiral in an infinite loop and bad memory accesses (see #15067)
+	if (height < 0)
+		height = 0;
+
 	_vm->_charsetColorMap[1] = col;
 	byte *cmap = _vm->_charsetColorMap;
 	const byte *src = _charPtr;




More information about the Scummvm-git-logs mailing list