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

hax0kartik noreply at scummvm.org
Wed Nov 15 03:29:03 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:
e6c0b4cdd4 CRAB: Fix crash due to incorrect calculation in map.cpp


Commit: e6c0b4cdd45fb564eaa332ae1f6d6ac6d2eb54bc
    https://github.com/scummvm/scummvm/commit/e6c0b4cdd45fb564eaa332ae1f6d6ac6d2eb54bc
Author: Kartik Agarwala (agarwala.kartik at gmail.com)
Date: 2023-11-15T08:58:29+05:30

Commit Message:
CRAB: Fix crash due to incorrect calculation in map.cpp

Changed paths:
    engines/crab/ui/map.cpp


diff --git a/engines/crab/ui/map.cpp b/engines/crab/ui/map.cpp
index e7c5c3d258c..630db45873a 100644
--- a/engines/crab/ui/map.cpp
+++ b/engines/crab/ui/map.cpp
@@ -125,9 +125,9 @@ void Map::draw(pyrodactyl::event::Info &info) {
 
 			// If we're outside the right edge, we need to cull the width and height
 			if (X + r.w > _pos.x + _camera.w)
-				r.w = _pos.x + _camera.w - X;
+				r.w = ABS(_pos.x + _camera.w - X); // abs to fix crash incase _pos.x + _camera.w < X
 			if (Y + r.h > _pos.y + _camera.h)
-				r.h = _pos.y + _camera.h - Y;
+				r.h = ABS(_pos.y + _camera.h - Y); // abs to fix crash incase _pos.y + _camera.h < Y
 
 			_imgOverlay.draw(X, Y, &r);
 		}




More information about the Scummvm-git-logs mailing list