[WIN32K:NTGDI]
authorThomas Faber <thomas.faber@reactos.org>
Sat, 8 Aug 2015 14:57:47 +0000 (14:57 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sat, 8 Aug 2015 14:57:47 +0000 (14:57 +0000)
- Improve invalid parameter handling in IntGdiExtCreatePen. Patch by Benedikt Freisen.
CORE-9740 #resolve

svn path=/trunk/; revision=68630

reactos/win32ss/gdi/ntgdi/pen.c

index c1a2ce0..058ca43 100644 (file)
@@ -135,6 +135,9 @@ IntGdiExtCreatePen(
     // If dwPenStyle is PS_COSMETIC, the width must be set to 1.
     if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && ( dwWidth != 1) )
         goto ExitCleanup;
+    // If dwPenStyle is PS_COSMETIC, the brush style must be BS_SOLID.
+    if ( !(bOldStylePen) && ((dwPenStyle & PS_TYPE_MASK) == PS_COSMETIC) && (ulBrushStyle != BS_SOLID) )
+        goto ExitCleanup;
 
     switch (dwPenStyle & PS_STYLE_MASK)
     {
@@ -205,6 +208,7 @@ IntGdiExtCreatePen(
 
     default:
         DPRINT1("IntGdiExtCreatePen unknown penstyle %x\n", dwPenStyle);
+        goto ExitCleanup;
     }
 
     PEN_UnlockPen(pbrushPen);