From 150b8dd013a686017eb696989dcc0b1b2121e7eb Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Fri, 15 Sep 2023 17:43:48 +0100 Subject: [PATCH] gdiplus: Copy the compound array in GdipClonePen(). --- dlls/gdiplus/pen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 6446b725e4d..fac31d6e84e 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -103,6 +103,7 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) (*clonepen)->customend = NULL; (*clonepen)->brush = NULL; (*clonepen)->dashes = NULL; + (*clonepen)->compound_array = NULL; stat = GdipCloneBrush(pen->brush, &(*clonepen)->brush); @@ -121,6 +122,15 @@ GpStatus WINGDIPAPI GdipClonePen(GpPen *pen, GpPen **clonepen) stat = OutOfMemory; } + if (stat == Ok && pen->compound_array) + { + (*clonepen)->compound_array = heap_alloc_zero(pen->compound_array_size * sizeof(REAL)); + if ((*clonepen)->compound_array) + memcpy((*clonepen)->compound_array, pen->compound_array, pen->compound_array_size * sizeof(REAL)); + else + stat = OutOfMemory; + } + if (stat != Ok) { GdipDeletePen(*clonepen);