From d982a71b8ab71913cb6431b8125c98a6b1ab861a Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 1 Nov 1998 14:04:15 +0000 Subject: [PATCH] Don't HeapFree() colormap if we didn't allocate one. --- objects/dib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/objects/dib.c b/objects/dib.c index a746cf97267..372a44fc03b 100644 --- a/objects/dib.c +++ b/objects/dib.c @@ -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 );