Commit 740bc043 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Fix for GpRegion clone helper.

parent 0940154b
......@@ -167,9 +167,12 @@ static inline GpStatus clone_element(const region_element* element,
{
GpStatus stat;
*element2 = GdipAlloc(sizeof(region_element));
if (!*element2)
return OutOfMemory;
/* root node is allocated with GpRegion */
if(!*element2){
*element2 = GdipAlloc(sizeof(region_element));
if (!*element2)
return OutOfMemory;
}
(*element2)->type = element->type;
......@@ -188,6 +191,9 @@ static inline GpStatus clone_element(const region_element* element,
if (stat != Ok) goto clone_out;
break;
default:
(*element2)->elementdata.combine.left = NULL;
(*element2)->elementdata.combine.right = NULL;
stat = clone_element(element->elementdata.combine.left,
&(*element2)->elementdata.combine.left);
if (stat != Ok) goto clone_out;
......@@ -344,7 +350,7 @@ GpStatus WINGDIPAPI GdipCombineRegionRectI(GpRegion *region,
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1,
GpRegion *region2, CombineMode mode)
{
region_element *left, *right;
region_element *left, *right = NULL;
GpStatus stat;
TRACE("%p %p %d\n", region1, region2, mode);
......
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