From 42d1d9e9e008d174db0c51e42b5c779538f9d350 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Mon, 21 Mar 2011 10:39:59 -0500 Subject: [PATCH] gdiplus: Clean up HRGN when GdipGetRegionBounds succeeds too. --- dlls/gdiplus/region.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index f11f3ca3669..0afbdbd3e4f 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -683,17 +683,18 @@ GpStatus WINGDIPAPI GdipGetRegionBounds(GpRegion *region, GpGraphics *graphics, return Ok; } - if(!GetRgnBox(hrgn, &r)){ - DeleteObject(hrgn); - return GenericError; + if(GetRgnBox(hrgn, &r)){ + rect->X = r.left; + rect->Y = r.top; + rect->Width = r.right - r.left; + rect->Height = r.bottom - r.top; } + else + status = GenericError; - rect->X = r.left; - rect->Y = r.top; - rect->Width = r.right - r.left; - rect->Height = r.bottom - r.top; + DeleteObject(hrgn); - return Ok; + return status; } /***************************************************************************** -- 2.11.4.GIT