gdiplus: Copy the compound array in GdipClonePen().

This commit is contained in:
Huw Davies 2023-09-15 17:43:48 +01:00 committed by Alexandre Julliard
parent f0525a5ff6
commit 150b8dd013

View file

@ -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);