From f817fb56e87cae9049d5d917382445345baeea3a Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 18 Feb 2013 21:29:12 +0800 Subject: [PATCH] gdiplus: Avoid a crash in GdipDrawImagePointRect. --- dlls/gdiplus/graphics.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index b9aa912664f..7d548716e81 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);