mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 11:16:11 +00:00
[WIN32K] Add missing NULL checks
Also fix an old copy-pasta.
This commit is contained in:
parent
5f4db56486
commit
090ccb3d8e
2 changed files with 11 additions and 1 deletions
|
@ -333,6 +333,11 @@ IntCreateCompatibleBitmap(
|
||||||
Planes ? Planes : 1,
|
Planes ? Planes : 1,
|
||||||
Bpp ? Bpp : dibs.dsBm.bmBitsPixel,
|
Bpp ? Bpp : dibs.dsBm.bmBitsPixel,
|
||||||
NULL);
|
NULL);
|
||||||
|
if (Bmp == NULL)
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to allocate a bitmap!\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
psurfBmp = SURFACE_ShareLockSurface(Bmp);
|
psurfBmp = SURFACE_ShareLockSurface(Bmp);
|
||||||
ASSERT(psurfBmp);
|
ASSERT(psurfBmp);
|
||||||
|
|
||||||
|
@ -342,7 +347,7 @@ IntCreateCompatibleBitmap(
|
||||||
/* Set flags */
|
/* Set flags */
|
||||||
psurfBmp->flags = API_BITMAP;
|
psurfBmp->flags = API_BITMAP;
|
||||||
psurfBmp->hdc = NULL; // FIXME:
|
psurfBmp->hdc = NULL; // FIXME:
|
||||||
psurf->SurfObj.hdev = (HDEV)Dc->ppdev;
|
psurfBmp->SurfObj.hdev = (HDEV)Dc->ppdev;
|
||||||
SURFACE_ShareUnlockSurface(psurfBmp);
|
SURFACE_ShareUnlockSurface(psurfBmp);
|
||||||
}
|
}
|
||||||
else if (Count == sizeof(DIBSECTION))
|
else if (Count == sizeof(DIBSECTION))
|
||||||
|
|
|
@ -69,6 +69,11 @@ CreateDIBPalette(
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
|
if (ppal == NULL)
|
||||||
|
{
|
||||||
|
DPRINT1("Failed to allocate palette.\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check if the BITMAPINFO specifies how many colors to use */
|
/* Check if the BITMAPINFO specifies how many colors to use */
|
||||||
if ((pbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) &&
|
if ((pbmi->bmiHeader.biSize >= sizeof(BITMAPINFOHEADER)) &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue