In GreCreateBitmapEx handle allocation failure in the rle hack path and set LastError, when failed to allocate bitmap bits.

svn path=/trunk/; revision=50344
This commit is contained in:
Timo Kreuzer 2011-01-09 18:53:58 +00:00
parent 39b87b357f
commit c2c492d850

View file

@ -107,6 +107,12 @@ GreCreateBitmapEx(
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 @@ GreCreateBitmapEx(
{
/* Bail out if that failed */
DPRINT1("SURFACE_bSetBitmapBits failed.\n");
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
SURFACE_FreeSurfaceByHandle(hbmp);
return NULL;
}