Author: gschneider
Date: Tue Jul  7 20:58:36 2009
New Revision: 41800

URL: http://svn.reactos.org/svn/reactos?rev=41800&view=rev
Log:
AlphaBlend:
- Return immediately if any bitmap size is smaller than zero
- Also check calculated input bitmap size against source size
- Remove outdated FIXME
- Fixes three gdi32 bitmap winetests

Modified:
    trunk/reactos/subsystems/win32/win32k/eng/alphablend.c
    trunk/reactos/subsystems/win32/win32k/objects/bitblt.c

Modified: trunk/reactos/subsystems/win32/win32k/eng/alphablend.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng/alphablend.c?rev=41800&r1=41799&r2=41800&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/alphablend.c [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/win32/win32k/eng/alphablend.c [iso-8859-1] Tue Jul 
 7 20:58:36 2009
@@ -54,7 +54,6 @@
            BlendObj->BlendFunction.BlendFlags, 
BlendObj->BlendFunction.SourceConstantAlpha,
            BlendObj->BlendFunction.AlphaFormat);
 
-
     /* Validate output */
     OutputRect = *DestRect;
     if (OutputRect.right < OutputRect.left)
@@ -68,14 +67,12 @@
         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;

Modified: trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/bitblt.c?rev=41800&r1=41799&r2=41800&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] 
(original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Tue Jul 
 7 20:58:36 2009
@@ -48,6 +48,12 @@
     XLATEOBJ *XlateObj;
     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)

Reply via email to