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:
Timo Kreuzer
2015-04-05 08:40:52 +00:00
parent d0071adf97
commit 77eb553987

View File

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