gdiplus: Avoid a crash in GdipDrawImagePointRect.

Dmitry Timoshkov dmitry at baikal.ru
Mon Feb 18 07:29:12 CST 2013


---
 dlls/gdiplus/graphics.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 659c46b..4a5b004 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -3053,6 +3053,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointRect(GpGraphics *graphics, GpImage *image,
 
     TRACE("(%p, %p, %f, %f, %f, %f, %f, %f, %d)\n", graphics, image, x, y, srcx, srcy, srcwidth, srcheight, srcUnit);
 
+    if (!graphics || !image) return InvalidParameter;
+
     scale_x = units_scale(srcUnit, graphics->unit, graphics->xres);
     scale_x *= graphics->xres / image->xres;
     scale_y = units_scale(srcUnit, graphics->unit, graphics->yres);
-- 
1.8.1.3




More information about the wine-patches mailing list