mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[WIN32K]
- Handle allocation failures in FixupDIBBrushPalette - In IntCreateDIBitmap make sure to the absolute height to GreCreateBitmap svn path=/trunk/; revision=66883
This commit is contained in:
parent
dcc59fc583
commit
e431dd155c
2 changed files with 13 additions and 2 deletions
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <win32k.h>
|
||||
|
||||
DBG_DEFAULT_CHANNEL(GdiFont);
|
||||
DBG_DEFAULT_CHANNEL(EngBrush);
|
||||
|
||||
static const ULONG gaulHatchBrushes[HS_DDI_MAX][8] =
|
||||
{
|
||||
|
@ -271,6 +271,11 @@ FixupDIBBrushPalette(
|
|||
0,
|
||||
0,
|
||||
0);
|
||||
if (ppalNew == NULL)
|
||||
{
|
||||
ERR("Failed to allcate palette for brush\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Loop all colors */
|
||||
for (i = 0; i < ppalDIB->NumColors; i++)
|
||||
|
@ -357,6 +362,12 @@ EBRUSHOBJ_bRealizeBrush(EBRUSHOBJ *pebo, BOOL bCallDriver)
|
|||
{
|
||||
/* Create a palette with the colors from the DC */
|
||||
ppalPattern = FixupDIBBrushPalette(psurfPattern->ppal, pebo->ppalDC);
|
||||
if (ppalPattern == NULL)
|
||||
{
|
||||
ERR("FixupDIBBrushPalette() failed.\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
pebo->ppalDIB = ppalPattern;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1379,7 +1379,7 @@ IntCreateDIBitmap(
|
|||
else
|
||||
{
|
||||
handle = GreCreateBitmap(width,
|
||||
height,
|
||||
abs(height),
|
||||
1,
|
||||
1,
|
||||
NULL);
|
||||
|
|
Loading…
Reference in a new issue