[Scummvm-git-logs] scummvm master -> 5a7eb689057f051d9c3c78109c3698cfc35e0909

a-yyg 76591232+a-yyg at users.noreply.github.com
Sat Aug 7 02:59:59 UTC 2021


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:
5a7eb68905 SAGA2: Fix for out-of-bounds intersect


Commit: 5a7eb689057f051d9c3c78109c3698cfc35e0909
    https://github.com/scummvm/scummvm/commit/5a7eb689057f051d9c3c78109c3698cfc35e0909
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-08-07T11:59:38+09:00

Commit Message:
SAGA2: Fix for out-of-bounds intersect

Changed paths:
    engines/saga2/rect.cpp


diff --git a/engines/saga2/rect.cpp b/engines/saga2/rect.cpp
index 61eee99d3b..2c0fbffc40 100644
--- a/engines/saga2/rect.cpp
+++ b/engines/saga2/rect.cpp
@@ -86,10 +86,10 @@ Rect16 intersect(const Rect16 a, const Rect16 b) {
 	y1      = MAX(a.y, b.y);
 	height  = MIN(a.y + a.height, b.y + b.height) - y1;
 
-//	if ( ( width <= 0 ) || ( height <= 0 ) )
-//		return Rect16( 0, 0, 0, 0 );
-//	else
-	return Rect16(x1, y1, width, height);
+	if ((width <= 0) || (height <= 0))
+		return Rect16(0, 0, 0, 0);
+	else
+		return Rect16(x1, y1, width, height);
 }
 
 void Rect16::normalize(void) {




More information about the Scummvm-git-logs mailing list