Author: gschneider Date: Sun Aug 16 21:56:40 2009 New Revision: 42743
URL: http://svn.reactos.org/svn/reactos?rev=42743&view=rev Log: Handle failure of EngCreateClip, spotted by Amine Khaldi
Modified: trunk/reactos/subsystems/win32/win32k/eng/engmisc.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/engmisc.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/eng... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/eng/engmisc.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/eng/engmisc.c [iso-8859-1] Sun Aug 16 21:56:40 2009 @@ -103,6 +103,12 @@ ClippedDestRect.bottom = ClippedDestRect.top + psoDest->sizlBitmap.cy - SrcPoint.y; } EnterLeave->TrivialClipObj = EngCreateClip(); + if (EnterLeave->TrivialClipObj == NULL) + { + EngUnlockSurface(*ppsoOutput); + EngDeleteSurface((HSURF)EnterLeave->OutputBitmap); + return FALSE; + } EnterLeave->TrivialClipObj->iDComplexity = DC_TRIVIAL; if (ClippedDestRect.left < (*ppsoOutput)->sizlBitmap.cx && 0 <= ClippedDestRect.right && @@ -115,11 +121,11 @@ EnterLeave->TrivialClipObj, NULL, &ClippedDestRect, &SrcPoint)) { - EngDeleteClip(EnterLeave->TrivialClipObj); - EngFreeMem((*ppsoOutput)->pvBits); - EngUnlockSurface(*ppsoOutput); - EngDeleteSurface((HSURF)EnterLeave->OutputBitmap); - return FALSE; + EngDeleteClip(EnterLeave->TrivialClipObj); + EngFreeMem((*ppsoOutput)->pvBits); + EngUnlockSurface(*ppsoOutput); + EngDeleteSurface((HSURF)EnterLeave->OutputBitmap); + return FALSE; } EnterLeave->DestRect.left = DestRect->left; EnterLeave->DestRect.top = DestRect->top;