From: David Kahurani k.kahurani@gmail.com
Empty the path, albeit temporarily before trying to lengthen the path because the data contained in it is at this point, unless an error happens, invalid. This avoids a situation where lengthening code, assuming the data in the path is valid proceeds to lengthen the path further.
Signed-off-by: David Kahurani k.kahurani@gmail.com --- dlls/gdiplus/graphicspath.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index ea9f1ed9aed..b40e84c07f3 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -2465,7 +2465,7 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, GpPath *flat_path=NULL; GpStatus status; path_list_node_t *points=NULL, *last_point=NULL; - int i, subpath_start=0, new_length; + int i, subpath_start=0, new_length, old_count;
TRACE("(%p,%p,%s,%0.2f)\n", path, pen, debugstr_matrix(matrix), flatness);
@@ -2475,6 +2475,8 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix, if (path->pathdata.Count <= 1) return OutOfMemory;
+ old_count = path->pathdata.Count; + status = GdipClonePath(path, &flat_path);
if (status == Ok) @@ -2550,8 +2552,12 @@ GpStatus WINGDIPAPI GdipWidenPath(GpPath *path, GpPen *pen, GpMatrix *matrix,
new_length = path_list_count(points)-1;
+ path->pathdata.Count = 0; if (!lengthen_path(path, new_length)) + { + path->pathdata.Count = old_count; status = OutOfMemory; + } }
if (status == Ok)