[ros-diffs] [greatlrd] 20411: DIB_CreateDIBSection fix do not zero
out memmory if it is a null pointer it got from
ExAllocatePoolWithTag
greatlrd at svn.reactos.com
greatlrd at svn.reactos.com
Thu Dec 29 02:57:59 CET 2005
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++)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051229/91c79b15/attachment.html
More information about the Ros-diffs
mailing list