[Scummvm-git-logs] scummvm master -> 0c9921b7411cc906e01d4048dc614da9e5bdab30

bluegr noreply at scummvm.org
Mon Sep 11 20:20:14 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:
0c9921b741 ACCESS: Fix crash on inventory item dragging in Amazon: GoE


Commit: 0c9921b7411cc906e01d4048dc614da9e5bdab30
    https://github.com/scummvm/scummvm/commit/0c9921b7411cc906e01d4048dc614da9e5bdab30
Author: PushmePullyu (127053144+PushmePullyu at users.noreply.github.com)
Date: 2023-09-11T23:20:09+03:00

Commit Message:
ACCESS: Fix crash on inventory item dragging in Amazon: GoE

Clamp bounding box to valid dimensions when copying to the screen
surface during item dragging.

Fixes #14617

Changed paths:
    engines/access/inventory.cpp


diff --git a/engines/access/inventory.cpp b/engines/access/inventory.cpp
index 8a647171c2a..61c70df340b 100644
--- a/engines/access/inventory.cpp
+++ b/engines/access/inventory.cpp
@@ -425,6 +425,10 @@ void InventoryManager::combineItems() {
 	screen._topSkip = screen._bottomSkip = 0;
 	screen._screenYOff = 0;
 
+	const Common::Rect screenBounds = screen.getBounds();
+	const int screenW = screenBounds.width();
+	const int screenH = screenBounds.height();
+
 	Common::Point tempMouse = events._mousePos;
 	Common::Point lastMouse = events._mousePos;
 
@@ -448,7 +452,7 @@ void InventoryManager::combineItems() {
 			continue;
 
 		lastMouse = events._mousePos;
-		Common::Rect lastRect(lastBox.x, lastBox.y, lastBox.x + 46, lastBox.y + 35);
+		Common::Rect lastRect(lastBox.x, lastBox.y, MIN(lastBox.x + 46, screenW), MIN(lastBox.y + 35, screenH));
 		screen.copyBlock(&_vm->_buffer2, lastRect);
 
 		Common::Point newPt;




More information about the Scummvm-git-logs mailing list