From f63dbb0bc16434a1baf9d2b72bfc031ce1eaeebb Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sat, 5 Feb 2011 14:22:11 -0600 Subject: [PATCH] gdiplus: Fix error path in GdipAddPathRectangle. Cloning the backup to &path only affects the local path variable. We need to modify the original path in place. --- dlls/gdiplus/graphicspath.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index c9d67b1..5a68147 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -1536,9 +1536,10 @@ GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y, fail: /* reverting */ - GdipDeletePath(path); - GdipClonePath(backup, &path); - GdipDeletePath(backup); + GdipFree(path->pathdata.Points); + GdipFree(path->pathdata.Types); + memcpy(path, backup, sizeof(*path)); + GdipFree(backup); return retstat; } @@ -1581,9 +1582,10 @@ GpStatus WINGDIPAPI GdipAddPathRectangles(GpPath *path, GDIPCONST GpRectF *rects fail: /* reverting */ - GdipDeletePath(path); - GdipClonePath(backup, &path); - GdipDeletePath(backup); + GdipFree(path->pathdata.Points); + GdipFree(path->pathdata.Types); + memcpy(path, backup, sizeof(*path)); + GdipFree(backup); return retstat; } -- 1.7.2.3