Commit 50cd5b6a authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Fix conversion of empty RECT to an empty CGRect.

For some empty RECTs, such as { INT_MAX, INT_MAX, INT_MIN, INT_MIN }, right minus left or bottom minus top underflow and wrap around to positive values.
parent 5fa7402a
......@@ -47,7 +47,9 @@ extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN;
static inline CGRect cgrect_from_rect(RECT rect)
{
return CGRectMake(rect.left, rect.top, max(0, rect.right - rect.left), max(0, rect.bottom - rect.top));
if (rect.left >= rect.right || rect.top >= rect.bottom)
return CGRectMake(rect.left, rect.top, 0, 0);
return CGRectMake(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top);
}
static inline RECT rect_from_cgrect(CGRect cgrect)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment