Commit 8b154a59 authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

gdiplus: Fix cleanup after errors in GdipCloneImage.

parent bf04d3fa
...@@ -746,12 +746,14 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage) ...@@ -746,12 +746,14 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
GdipBitmapUnlockBits((GpBitmap*)*cloneImage, &lockeddata_dst); GdipBitmapUnlockBits((GpBitmap*)*cloneImage, &lockeddata_dst);
} }
GdipBitmapUnlockBits(bitmap, &lockeddata_src); if (stat != Ok)
GdipDisposeImage(*cloneImage);
} }
GdipBitmapUnlockBits(bitmap, &lockeddata_src);
if (stat != Ok) if (stat != Ok)
{ {
GdipDisposeImage(*cloneImage);
*cloneImage = NULL; *cloneImage = NULL;
} }
else memcpy(&(*cloneImage)->format, &image->format, sizeof(GUID)); else memcpy(&(*cloneImage)->format, &image->format, sizeof(GUID));
......
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