Commit c509615f authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

Checking for NULL-pointer.

parent 84923b37
......@@ -99,10 +99,13 @@ HPALETTE32 WINAPI CreatePalette32(
{
PALETTEOBJ * palettePtr;
HPALETTE32 hpalette;
int size = sizeof(LOGPALETTE) + (palette->palNumEntries - 1) * sizeof(PALETTEENTRY);
int size;
if (!palette) return 0;
TRACE(palette,"entries=%i\n", palette->palNumEntries);
size = sizeof(LOGPALETTE) + (palette->palNumEntries - 1) * sizeof(PALETTEENTRY);
hpalette = GDI_AllocObject( size + sizeof(int*) +sizeof(GDIOBJHDR) , PALETTE_MAGIC );
if (!hpalette) return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment