gdiplus: Fix erroneous pen error checking.

This commit is contained in:
Evan Stade 2007-06-22 19:24:50 -07:00 committed by Alexandre Julliard
parent 6baacf61a8
commit 02efd4bbf1
1 changed files with 5 additions and 4 deletions

View File

@ -33,8 +33,11 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, FLOAT width, GpUnit unit,
LOGBRUSH lb;
GpPen *gp_pen;
if(!pen)
return InvalidParameter;
gp_pen = GdipAlloc(sizeof(GpPen));
if(!pen) return OutOfMemory;
if(!gp_pen) return OutOfMemory;
gp_pen->style = GP_DEFAULT_PENSTYLE;
gp_pen->color = ARGB2COLORREF(color);
@ -51,12 +54,10 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, FLOAT width, GpUnit unit,
0, NULL);
} else {
FIXME("UnitWorld, UnitPixel only supported units\n");
GdipFree(gp_pen);
return NotImplemented;
}
if(!gp_pen)
return GenericError;
*pen = gp_pen;
return Ok;