mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:15:59 +00:00
- Handle allocation failure in IntCreateBitmap.
- Don't allow creating surface with BitmapFormat == 0 (Invalid) in IntCreateSurface. svn path=/trunk/; revision=10013
This commit is contained in:
parent
eb298d6e01
commit
bf1db388a0
1 changed files with 12 additions and 3 deletions
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: surface.c,v 1.43 2004/07/03 13:55:35 navaraf Exp $
|
||||
/* $Id: surface.c,v 1.44 2004/07/07 16:33:44 navaraf Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -223,6 +223,9 @@ IntCreateBitmap(IN SIZEL Size,
|
|||
PVOID UncompressedBits;
|
||||
ULONG UncompressedFormat;
|
||||
|
||||
if (Format == 0)
|
||||
return 0;
|
||||
|
||||
NewBitmap = BITMAPOBJ_AllocBitmap();
|
||||
if (NewBitmap == NULL)
|
||||
return 0;
|
||||
|
@ -274,8 +277,14 @@ IntCreateBitmap(IN SIZEL Size,
|
|||
{
|
||||
SurfObj->pvBits = EngAllocMem(0 != (Flags & BMF_NOZEROINIT) ? 0 : FL_ZERO_MEMORY,
|
||||
SurfObj->cjBits, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (SurfObj->pvBits == NULL)
|
||||
{
|
||||
BITMAPOBJ_UnlockBitmap(NewBitmap);
|
||||
BITMAPOBJ_FreeBitmap(NewBitmap);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue