mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Merge pull request #4339 from akallabeth/gdi_sw_crash_fix
Fixed #4336: Initialize rectangle.
This commit is contained in:
@@ -187,20 +187,29 @@ INLINE void gdi_RgnToRect(HGDI_RGN rgn, HGDI_RECT rect)
|
||||
INLINE void gdi_CRgnToRect(INT64 x, INT64 y, UINT32 w, UINT32 h,
|
||||
HGDI_RECT rect)
|
||||
{
|
||||
BOOL invalid = FALSE;
|
||||
const INT64 r = x + w - 1;
|
||||
const INT64 b = y + h - 1;
|
||||
rect->left = (x > 0) ? x : 0;
|
||||
rect->top = (y > 0) ? y : 0;
|
||||
rect->right = rect->left;
|
||||
rect->bottom = rect->top;
|
||||
|
||||
if (r > 0)
|
||||
rect->right = r;
|
||||
else
|
||||
WLog_ERR(TAG, "Invalid width");
|
||||
invalid = TRUE;
|
||||
|
||||
if (b > 0)
|
||||
rect->bottom = b;
|
||||
else
|
||||
WLog_ERR(TAG, "Invalid height");
|
||||
invalid = TRUE;
|
||||
|
||||
if (invalid)
|
||||
{
|
||||
WLog_DBG(TAG, "Invisible rectangle %"PRId64"x%"PRId64"-%"PRId64"x%"PRId64,
|
||||
x, y, r, b);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user