mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
EngCreateBitmap may return null. Add return value checks
svn path=/trunk/; revision=21589
This commit is contained in:
@@ -68,6 +68,13 @@ IntEngEnter(PINTENG_ENTER_LEAVE EnterLeave,
|
||||
EnterLeave->OutputBitmap = EngCreateBitmap(BitmapSize, Width,
|
||||
DestObj->iBitmapFormat,
|
||||
BMF_TOPDOWN | BMF_NOZEROINIT, NULL);
|
||||
|
||||
if (!EnterLeave->OutputBitmap)
|
||||
{
|
||||
DPRINT1("EngCreateBitmap() failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*OutputObj = EngLockSurface((HSURF)EnterLeave->OutputBitmap);
|
||||
|
||||
EnterLeave->DestRect.left = 0;
|
||||
|
||||
@@ -122,6 +122,12 @@ EngCreateDeviceBitmap(IN DHSURF dhsurf,
|
||||
SURFOBJ *SurfObj;
|
||||
|
||||
NewBitmap = EngCreateBitmap(Size, DIB_GetDIBWidthBytes(Size.cx, BitsPerFormat(Format)), Format, 0, NULL);
|
||||
if(!NewBitmap)
|
||||
{
|
||||
DPRINT1("EngCreateBitmap failed\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
SurfObj = EngLockSurface((HSURF)NewBitmap);
|
||||
SurfObj->dhsurf = dhsurf;
|
||||
EngUnlockSurface(SurfObj);
|
||||
|
||||
Reference in New Issue
Block a user