[ros-diffs] [tkreuzer] 33793: IntGdiLineTo: the dc pen might be deleted, don't assert, instead fall back to BLACK_PEN, fixes a crash when using FF

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sun Jun 1 02:54:09 CEST 2008


Author: tkreuzer
Date: Sat May 31 19:54:08 2008
New Revision: 33793

URL: http://svn.reactos.org/svn/reactos?rev=33793&view=rev
Log:
IntGdiLineTo: the dc pen might be deleted, don't assert, instead fall back to BLACK_PEN, fixes a crash when using FF

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

Modified: trunk/reactos/subsystems/win32/win32k/objects/line.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/line.c?rev=33793&r1=33792&r2=33793&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/line.c [iso-8859-1] Sat May 31 19:54:08 2008
@@ -142,8 +142,12 @@
 
         /* get BRUSHOBJ from current pen. */
         PenBrushObj = PENOBJ_LockPen( Dc_Attr->hpen );
-        /* FIXME - PenBrushObj can be NULL!!!! Don't assert here! */
-        ASSERT(PenBrushObj);
+        if (!PenBrushObj)
+        {
+            /* default to BLACK_PEN */
+            PenBrushObj = PENOBJ_LockPen(NtGdiGetStockObject(BLACK_PEN));
+            ASSERT(PenBrushObj);
+        }
 
         if (!(PenBrushObj->flAttrs & GDIBRUSH_IS_NULL))
         {



More information about the Ros-diffs mailing list