From 31acf7f5a521fb3f4418a7db8e7fc792af6a967c Mon Sep 17 00:00:00 2001 From: Juan Lang Date: Thu, 14 Jul 2005 10:15:42 +0000 Subject: [PATCH] Release DC in error condition on StretchDIBits. --- dlls/gdi/dib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/gdi/dib.c b/dlls/gdi/dib.c index c42921e4401..5b5fc84882c 100644 --- a/dlls/gdi/dib.c +++ b/dlls/gdi/dib.c @@ -233,6 +233,8 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, WORD planes, bpp; DWORD compr, size; + GDI_ReleaseObj( hdc ); + if (DIB_GetBitmapInfo( &info->bmiHeader, &width, &height, &planes, &bpp, &compr, &size ) == -1) { ERR("Invalid bitmap\n"); @@ -245,7 +247,6 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, return 0; } - GDI_ReleaseObj( hdc ); hdcMem = CreateCompatibleDC( hdc ); hBitmap = CreateCompatibleBitmap(hdc, width, height); hOldBitmap = SelectObject( hdcMem, hBitmap ); -- 2.11.4.GIT