DIB_CreateDIBSection fix do not zero out memmory if it is a null pointer
it got from ExAllocatePoolWithTag
DIB_MapPaletteColors do not try write to NULL pointer if
ExAllocatePoolWithTag do return a NULLL pointer.
Modified: trunk/reactos/subsys/win32k/objects/dib.c
_____
Modified: trunk/reactos/subsys/win32k/objects/dib.c
--- 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++)
Show replies by date