diff --git a/reactos/subsystems/win32/win32k/eng/alphablend.c b/reactos/subsystems/win32/win32k/eng/alphablend.c index 7ccab538e12..30ba88fd386 100644 --- a/reactos/subsystems/win32/win32k/eng/alphablend.c +++ b/reactos/subsystems/win32/win32k/eng/alphablend.c @@ -54,7 +54,6 @@ EngAlphaBlend(IN SURFOBJ *psoDest, BlendObj->BlendFunction.BlendFlags, BlendObj->BlendFunction.SourceConstantAlpha, BlendObj->BlendFunction.AlphaFormat); - /* Validate output */ OutputRect = *DestRect; if (OutputRect.right < OutputRect.left) @@ -68,14 +67,12 @@ EngAlphaBlend(IN SURFOBJ *psoDest, OutputRect.right = DestRect->left; } - /* Validate input */ - - /* FIXME when WindowOrg.x or .y are negitve this check are not vaild, - * we need convert the inputRect to the windows org and do it right */ InputRect = *SourceRect; if ( (InputRect.top < 0) || (InputRect.bottom < 0) || - (InputRect.left < 0) || (InputRect.right < 0) ) + (InputRect.left < 0) || (InputRect.right < 0) || + InputRect.right > psoSource->sizlBitmap.cx || + InputRect.bottom > psoSource->sizlBitmap.cy ) { SetLastWin32Error(ERROR_INVALID_PARAMETER); return FALSE; diff --git a/reactos/subsystems/win32/win32k/objects/bitblt.c b/reactos/subsystems/win32/win32k/objects/bitblt.c index fe5d994efa0..29159a35d6e 100644 --- a/reactos/subsystems/win32/win32k/objects/bitblt.c +++ b/reactos/subsystems/win32/win32k/objects/bitblt.c @@ -49,6 +49,12 @@ NtGdiAlphaBlend( BLENDOBJ BlendObj; BlendObj.BlendFunction = BlendFunc; + if (WidthDest < 0 || HeightDest < 0 || WidthSrc < 0 || HeightSrc < 0) + { + SetLastWin32Error(ERROR_INVALID_PARAMETER); + return FALSE; + } + DCDest = DC_LockDc(hDCDest); if (NULL == DCDest) {