mirror of
https://github.com/reactos/reactos.git
synced 2025-03-30 17:10:22 +00:00
EngCreateBitmap may return null. Add return value checks
svn path=/trunk/; revision=21589
This commit is contained in:
parent
477fabfce2
commit
a9161f0913
2 changed files with 13 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue