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

sev- noreply at scummvm.org
Sun Jul 31 20:54:23 UTC 2022


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:
f85abaa739 WAGE: Do not crash if asked to draw beyond the window borders.


Commit: f85abaa739ed398735ec03b5d8b55e0abee1268c
    https://github.com/scummvm/scummvm/commit/f85abaa739ed398735ec03b5d8b55e0abee1268c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2022-07-31T22:54:07+02:00

Commit Message:
WAGE: Do not crash if asked to draw beyond the window borders.

Fixes crash in Nightcrawler Ned game

Changed paths:
    engines/wage/design.cpp


diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp
index d3bca8c043c..05cac77790f 100644
--- a/engines/wage/design.cpp
+++ b/engines/wage/design.cpp
@@ -487,7 +487,12 @@ void Design::drawBitmap(Graphics::ManagedSurface *surface, Common::SeekableReadS
 		}
 		ff.fill();
 
-		for (y = 0; y < h && y1 + y < surface->h; y++) {
+		y = 0;
+
+		if (y1 < 0)
+			y = -y1;
+
+		for (; y < h && y1 + y < surface->h; y++) {
 			byte *src = (byte *)tmp.getBasePtr(0, y);
 			byte *dst = (byte *)surface->getBasePtr(x1, y1 + y);
 			for (x = 0; x < w; x++) {




More information about the Scummvm-git-logs mailing list