mirror of
https://github.com/reactos/reactos.git
synced 2026-07-06 23:44:40 +08:00
[WIN32K]
Check in BltMask if the masking operation would exceed the mask bitmap. Should fix crash when running gdi32_apitest MaskBlt. CORE-9483 svn path=/trunk/; revision=67058
This commit is contained in:
@@ -51,7 +51,7 @@ BltMask(SURFOBJ* psoDest,
|
||||
POINTL* pptlBrush,
|
||||
ROP4 Rop4)
|
||||
{
|
||||
LONG x, y;
|
||||
LONG x, y, cx, cy;
|
||||
BYTE *pjMskLine, *pjMskCurrent;
|
||||
BYTE fjMaskBit0, fjMaskBit;
|
||||
/* Pattern brushes */
|
||||
@@ -88,6 +88,14 @@ BltMask(SURFOBJ* psoDest,
|
||||
else
|
||||
psoPattern = NULL;
|
||||
|
||||
cx = prclDest->right - prclDest->left;
|
||||
cy = prclDest->bottom - prclDest->top;
|
||||
if ((pptlMask->x + cx > psoMask->sizlBitmap.cx) ||
|
||||
(pptlMask->y + cy > psoMask->sizlBitmap.cy))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pjMskLine = (PBYTE)psoMask->pvScan0 + pptlMask->y * psoMask->lDelta + (pptlMask->x >> 3);
|
||||
fjMaskBit0 = 0x80 >> (pptlMask->x & 0x07);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user