[ros-diffs] [fireball] 30920: - Move the check for a NULL dc higher (before it's actually used). Fixes crashes (in FireFox, for example).

fireball at svn.reactos.org fireball at svn.reactos.org
Fri Nov 30 21:19:25 CET 2007


Author: fireball
Date: Fri Nov 30 23:19:25 2007
New Revision: 30920

URL: http://svn.reactos.org/svn/reactos?rev=30920&view=rev
Log:
- Move the check for a NULL dc higher (before it's actually used). Fixes crashes (in FireFox, for example).

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

Modified: trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c?rev=30920&r1=30919&r2=30920&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/gdibatch.c Fri Nov 30 23:19:25 2007
@@ -23,6 +23,8 @@
   if (hDC)
   {
     dc = DC_LockDc(hDC);
+    if (!dc)
+        return pHdr->Size; // Return the full size of the structure.
     Dc_Attr = dc->pDc_Attr;
     if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
   }
@@ -40,7 +42,6 @@
      case GdiBCSetBrushOrg:
      {
         PGDIBSSETBRHORG pgSBO;
-        if (!dc) break;
         pgSBO = (PGDIBSSETBRHORG) pHdr;
         Dc_Attr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
         break;




More information about the Ros-diffs mailing list