Skip to content

Commit 77eb553

Browse files
committed
[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
1 parent d0071ad commit 77eb553

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

reactos/win32ss/gdi/eng/bitblt.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ BltMask(SURFOBJ* psoDest,
5151
POINTL* pptlBrush,
5252
ROP4 Rop4)
5353
{
54-
LONG x, y;
54+
LONG x, y, cx, cy;
5555
BYTE *pjMskLine, *pjMskCurrent;
5656
BYTE fjMaskBit0, fjMaskBit;
5757
/* Pattern brushes */
@@ -88,6 +88,14 @@ BltMask(SURFOBJ* psoDest,
8888
else
8989
psoPattern = NULL;
9090

91+
cx = prclDest->right - prclDest->left;
92+
cy = prclDest->bottom - prclDest->top;
93+
if ((pptlMask->x + cx > psoMask->sizlBitmap.cx) ||
94+
(pptlMask->y + cy > psoMask->sizlBitmap.cy))
95+
{
96+
return FALSE;
97+
}
98+
9199
pjMskLine = (PBYTE)psoMask->pvScan0 + pptlMask->y * psoMask->lDelta + (pptlMask->x >> 3);
92100
fjMaskBit0 = 0x80 >> (pptlMask->x & 0x07);
93101

0 commit comments

Comments
 (0)