--- trunk/reactos/subsys/win32k/objects/dib.c 2005-12-29 00:04:34 UTC (rev 20410)
+++ trunk/reactos/subsys/win32k/objects/dib.c 2005-12-29 01:57:50 UTC (rev 20411)
@@ -866,7 +866,7 @@
if (bm.bmBits)
{
dib = ExAllocatePoolWithTag(PagedPool, sizeof(DIBSECTION), TAG_DIB);
- RtlZeroMemory(dib, sizeof(DIBSECTION));
+ if (dib != NULL) RtlZeroMemory(dib, sizeof(DIBSECTION));
}
if (dib)
@@ -1125,6 +1125,12 @@
}
lpRGB = (RGBQUAD *)ExAllocatePoolWithTag(PagedPool, sizeof(RGBQUAD) * nNumColors, TAG_COLORMAP);
+ if (lpRGB == NULL)
+ {
+ PALETTE_UnlockPalette(palGDI);
+ return NULL;
+ }
+
lpIndex = (USHORT *)&lpbmi->bmiColors[0];
for (i = 0; i < nNumColors; i++)