[PATCH] gdiplus: do not memcpy over NULL ptrs (Coverity)
Marcus Meissner
marcus at jet.franken.de
Sun Sep 20 11:48:39 CDT 2009
Hi,
valid complaint, in error case the pointer would be NULL.
Ciao, Marcus
---
dlls/gdiplus/image.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c
index f71bf9a..a79e7a6 100644
--- a/dlls/gdiplus/image.c
+++ b/dlls/gdiplus/image.c
@@ -413,8 +413,10 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage)
GdipDisposeImage(*cloneImage);
*cloneImage = NULL;
}
-
- memcpy(&(*cloneImage)->format, &image->format, sizeof(GUID));
+ else
+ {
+ memcpy(&(*cloneImage)->format, &image->format, sizeof(GUID));
+ }
return stat;
}
--
1.5.6
More information about the wine-patches
mailing list