SAGA2: Fix for out-of-bounds intersect

This commit is contained in:
a/ 2021-08-07 11:59:38 +09:00
parent 13310e555e
commit 5a7eb68905

View File

@ -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) {