Author: tkreuzer
Date: Sun Jan 9 18:53:58 2011
New Revision: 50344
URL:
http://svn.reactos.org/svn/reactos?rev=50344&view=rev
Log:
[WIN32K]
In GreCreateBitmapEx handle allocation failure in the rle hack path and set LastError,
when failed to allocate bitmap bits.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Sun Jan 9
18:53:58 2011
@@ -107,6 +107,12 @@
sizl.cy = nHeight;
pvCompressedBits = pvBits;
pvBits = EngAllocMem(FL_ZERO_MEMORY, pso->cjBits, TAG_DIB);
+ if (!pvBits)
+ {
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ SURFACE_FreeSurfaceByHandle(hbmp);
+ return NULL;
+ }
DecompressBitmap(sizl, pvCompressedBits, pvBits, pso->lDelta, iFormat);
fjBitmap |= BMF_RLE_HACK;
}
@@ -119,6 +125,7 @@
{
/* Bail out if that failed */
DPRINT1("SURFACE_bSetBitmapBits failed.\n");
+ EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
SURFACE_FreeSurfaceByHandle(hbmp);
return NULL;
}