Don't HeapFree() colormap if we didn't allocate one.

This commit is contained in:
Marcus Meissner 1998-11-01 14:04:15 +00:00 committed by Alexandre Julliard
parent 9cfe2d5384
commit d982a71b8a
1 changed files with 3 additions and 2 deletions

View File

@ -1280,7 +1280,8 @@ INT32 WINAPI SetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
GDI_HEAP_UNLOCK( hdc );
return 0;
}
}
} else
descr.colorMap = 0;
/* HACK for now */
if(!bmp->DDBitmap)
@ -1306,7 +1307,7 @@ INT32 WINAPI SetDIBits32( HDC32 hdc, HBITMAP32 hbitmap, UINT32 startscan,
result = CALL_LARGE_STACK( DIB_SetImageBits, &descr );
LeaveCriticalSection( &X11DRV_CritSection );
HeapFree(GetProcessHeap(), 0, descr.colorMap);
if (descr.colorMap) HeapFree(GetProcessHeap(), 0, descr.colorMap);
GDI_HEAP_UNLOCK( hdc );
GDI_HEAP_UNLOCK( hbitmap );