Evan Stade : gdiplus: Fix erroneous pen error checking.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Jun 25 07:28:14 CDT 2007
Module: wine
Branch: master
Commit: 02efd4bbf1afdc9cba8c7e824d85bb7f7b6a7319
URL: http://source.winehq.org/git/wine.git/?a=commit;h=02efd4bbf1afdc9cba8c7e824d85bb7f7b6a7319
Author: Evan Stade <estade at gmail.com>
Date: Fri Jun 22 19:24:50 2007 -0700
gdiplus: Fix erroneous pen error checking.
---
dlls/gdiplus/pen.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c
index d0355db..9ee72d9 100644
--- a/dlls/gdiplus/pen.c
+++ b/dlls/gdiplus/pen.c
@@ -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;
More information about the wine-cvs
mailing list