From: Gregor Schneider Date: Sun, 16 Aug 2009 20:11:31 +0000 (+0000) Subject: Handle failure of EngLockSurface as well X-Git-Tag: ReactOS-0.3.11~1134 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=c365f1c1bbe63a590c41a9314b486eff0f322353 Handle failure of EngLockSurface as well svn path=/trunk/; revision=42745 --- diff --git a/reactos/subsystems/win32/win32k/eng/engmisc.c b/reactos/subsystems/win32/win32k/eng/engmisc.c index 183e010db9b..ed45e5b7c6d 100644 --- a/reactos/subsystems/win32/win32k/eng/engmisc.c +++ b/reactos/subsystems/win32/win32k/eng/engmisc.c @@ -76,6 +76,11 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, } *ppsoOutput = EngLockSurface((HSURF)EnterLeave->OutputBitmap); + if (*ppsoOutput == NULL) + { + EngDeleteSurface((HSURF)EnterLeave->OutputBitmap); + return FALSE; + } EnterLeave->DestRect.left = 0; EnterLeave->DestRect.top = 0; @@ -105,9 +110,9 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave, EnterLeave->TrivialClipObj = EngCreateClip(); if (EnterLeave->TrivialClipObj == NULL) { - EngUnlockSurface(*ppsoOutput); - EngDeleteSurface((HSURF)EnterLeave->OutputBitmap); - return FALSE; + EngUnlockSurface(*ppsoOutput); + EngDeleteSurface((HSURF)EnterLeave->OutputBitmap); + return FALSE; } EnterLeave->TrivialClipObj->iDComplexity = DC_TRIVIAL; if (ClippedDestRect.left < (*ppsoOutput)->sizlBitmap.cx &&