[ros-diffs] [gschneider] 39510: - Remove coordinate checks from NtGdiStretchBlt, since they're done at a later stage differently now - Fixes a div/0 crash that happened in XnView and Acrobat Reader 9 Setup

gschneider at svn.reactos.org gschneider at svn.reactos.org
Mon Feb 9 14:10:40 CET 2009


Author: gschneider
Date: Mon Feb  9 07:10:39 2009
New Revision: 39510

URL: http://svn.reactos.org/svn/reactos?rev=39510&view=rev
Log:
- Remove coordinate checks from NtGdiStretchBlt, since they're done at a later stage differently now
- Fixes a div/0 crash that happened in XnView and Acrobat Reader 9 Setup

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

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=39510&r1=39509&r2=39510&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] Mon Feb  9 07:10:39 2009
@@ -857,56 +857,6 @@
                 goto failed;
         }
 
-        int sw = BitmapSrc->SurfObj.sizlBitmap.cx;
-        int sh = BitmapSrc->SurfObj.sizlBitmap.cy;
-        if ( SourceRect.left < 0 )
-        {
-            DestRect.left = DestRect.right - (DestRect.right-DestRect.left) * (SourceRect.right)/abs(SourceRect.right-SourceRect.left);
-            SourceRect.left = 0;
-        }
-        if ( SourceRect.top < 0 )
-        {
-            DestRect.top = DestRect.bottom - (DestRect.bottom-DestRect.top) * (SourceRect.bottom)/abs(SourceRect.bottom-SourceRect.top);
-            SourceRect.top = 0;
-        }
-        if ( SourceRect.right < -1 )
-        {
-            DestRect.right = DestRect.left + (DestRect.right-DestRect.left) * (-1-SourceRect.left)/abs(SourceRect.right-SourceRect.left);
-            SourceRect.right = -1;
-        }
-        if ( SourceRect.bottom < -1 )
-        {
-            DestRect.bottom = DestRect.top + (DestRect.bottom-DestRect.top) * (-1-SourceRect.top)/abs(SourceRect.bottom-SourceRect.top);
-            SourceRect.bottom = -1;
-        }
-        if ( SourceRect.right > sw )
-        {
-            DestRect.right = DestRect.left + (DestRect.right-DestRect.left) * abs(sw-SourceRect.left) / abs(SourceRect.right-SourceRect.left);
-            SourceRect.right = sw;
-        }
-        if ( SourceRect.bottom > sh )
-        {
-            DestRect.bottom = DestRect.top + (DestRect.bottom-DestRect.top) * abs(sh-SourceRect.top) / abs(SourceRect.bottom-SourceRect.top);
-            SourceRect.bottom = sh;
-        }
-        sw--;
-        sh--;
-        if ( SourceRect.left > sw )
-        {
-            DestRect.left = DestRect.right - (DestRect.right-DestRect.left) * (SourceRect.right-sw) / abs(SourceRect.right-SourceRect.left);
-            SourceRect.left = 0;
-        }
-        if ( SourceRect.top > sh )
-        {
-            DestRect.top = DestRect.bottom - (DestRect.bottom-DestRect.top) * (SourceRect.bottom-sh) / abs(SourceRect.bottom-SourceRect.top);
-            SourceRect.top = 0;
-        }
-        if (0 == (DestRect.right-DestRect.left) || 0 == (DestRect.bottom-DestRect.top) || 0 == (SourceRect.right-SourceRect.left) || 0 == (SourceRect.bottom-SourceRect.top))
-        {
-            SetLastWin32Error(ERROR_INVALID_PARAMETER);
-            goto failed;
-        }
-
         /* Create the XLATEOBJ. */
         XlateObj = IntCreateXlateForBlt(DCDest, DCSrc, BitmapDest, BitmapSrc);
         if (XlateObj == (XLATEOBJ*)-1)



More information about the Ros-diffs mailing list