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

sev- noreply at scummvm.org
Sun Nov 19 16:37:11 UTC 2023


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:
3af9cc0bf8 SLUDGE: Fix out-of-bounds read when redering ZBuffer


Commit: 3af9cc0bf863bac950cd9fdd9420f26bb485a9c2
    https://github.com/scummvm/scummvm/commit/3af9cc0bf863bac950cd9fdd9420f26bb485a9c2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-11-19T17:36:19+01:00

Commit Message:
SLUDGE: Fix out-of-bounds read when redering ZBuffer

Fixed crash at the end credits in outoforder. Bug #13708

Changed paths:
    engines/sludge/zbuffer.cpp


diff --git a/engines/sludge/zbuffer.cpp b/engines/sludge/zbuffer.cpp
index 9c26241a6d4..d44899109ae 100644
--- a/engines/sludge/zbuffer.cpp
+++ b/engines/sludge/zbuffer.cpp
@@ -193,8 +193,11 @@ void GraphicsManager::drawZBuffer(int x, int y, bool upsidedown) {
 
 	fillZBuffer(0);
 
-	for (uint y1 = y; y1 < _winHeight + y; y1++) {
-		for (uint x1 = x; x1 < _winWidth + x; x1++) {
+	int w = MIN<uint>(_zBuffer->width, _winWidth + x);
+	int h = MIN<uint>(_zBuffer->height, _winHeight + y);
+
+	for (uint y1 = y; y1 < h; y1++) {
+		for (uint x1 = x; x1 < w; x1++) {
 
 			uint8 z = 0;
 




More information about the Scummvm-git-logs mailing list