Commit dc047ecd authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Add error checking to GdipClonePen.

parent 814f9cf7
...@@ -87,6 +87,8 @@ static GpPenType bt_to_pt(GpBrushType bt) ...@@ -87,6 +87,8 @@ static GpPenType bt_to_pt(GpBrushType bt)
GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
{ {
GpStatus stat;
TRACE("(%p, %p)\n", pen, clonepen); TRACE("(%p, %p)\n", pen, clonepen);
if(!pen || !clonepen) if(!pen || !clonepen)
...@@ -97,9 +99,24 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) ...@@ -97,9 +99,24 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen)
**clonepen = *pen; **clonepen = *pen;
GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart); (*clonepen)->customstart = NULL;
GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend); (*clonepen)->customend = NULL;
GdipCloneBrush(pen->brush, &(*clonepen)->brush); (*clonepen)->brush = NULL;
stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush);
if (stat == Ok && pen->customstart)
stat = GdipCloneCustomLineCap(pen->customstart, &(*clonepen)->customstart);
if (stat == Ok && pen->customend)
stat = GdipCloneCustomLineCap(pen->customend, &(*clonepen)->customend);
if (stat != Ok)
{
GdipDeletePen(*clonepen);
*clonepen = NULL;
return stat;
}
TRACE("<-- %p\n", *clonepen); TRACE("<-- %p\n", *clonepen);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment