[ros-diffs] [tkreuzer] 50344: [WIN32K] In GreCreateBitmapEx handle allocation failure in the rle hack path and set LastError, when failed to allocate bitmap bits.

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Sun Jan 9 18:53:59 UTC 2011


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/objects/bitmaps.c?rev=50344&r1=50343&r2=50344&view=diff
==============================================================================
--- 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;
     }




More information about the Ros-diffs mailing list