From dc7c1b87d4a0820572d4f6e1c0f64a149f0fdc31 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Sun, 18 Apr 1999 13:12:02 +0000 Subject: [PATCH] Fixed a few bugs (typos from cut & paste & invalid heap block freeing). --- graphics/x11drv/dib.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/graphics/x11drv/dib.c b/graphics/x11drv/dib.c index 2ff7a19e38f..5cd93ea98b9 100644 --- a/graphics/x11drv/dib.c +++ b/graphics/x11drv/dib.c @@ -732,7 +732,7 @@ static void X11DRV_DIB_SetImageBits_16( int lines, const BYTE *srcbits, imageBits[(x << 1) + indB] = (BYTE)(((val << 1) & 0x00c0) | (val & 0x001f)); } ptr = (LPWORD)(srcbits += linebytes) + left; - imageBits -= bmpImage->bytes_per_line; + imageBits += bmpImage->bytes_per_line; } } return; @@ -758,7 +758,7 @@ static void X11DRV_DIB_SetImageBits_16( int lines, const BYTE *srcbits, } } else { lines = -lines; - imageBits = (BYTE *)(bmpImage->data + (lines - 1)*bmpImage->bytes_per_line); + imageBits = (BYTE *)bmpImage->data; for (h = 0; h < lines; h++) { for (x = left; x < dstwidth; x++, ptr ++) { val = *ptr; @@ -768,7 +768,7 @@ static void X11DRV_DIB_SetImageBits_16( int lines, const BYTE *srcbits, imageBits[(x << 2) + indD] = (BYTE)(((val << 3) & 0x00f8) | ((val >> 2) & 0x0007)); } ptr = (LPWORD)(srcbits += linebytes) + left; - imageBits -= bmpImage->bytes_per_line; + imageBits += bmpImage->bytes_per_line; } } return; @@ -1406,7 +1406,8 @@ INT X11DRV_SetDIBitsToDevice( DC *dc, INT xDest, INT yDest, DWORD cx, result = CALL_LARGE_STACK( X11DRV_DIB_SetImageBits, &descr ); LeaveCriticalSection( &X11DRV_CritSection ); - HeapFree(GetProcessHeap(), 0, descr.colorMap); + if (descr.infoBpp <= 8) + HeapFree(GetProcessHeap(), 0, descr.colorMap); return result; }