Fixed CreateDIBSection() called with negative height to set the height

positive in the created DIBSECTION, as per MS knowledgebase Q186586.
This commit is contained in:
Kristian Nielsen 1999-08-21 13:07:27 +00:00 committed by Alexandre Julliard
parent e5711ebea4
commit 3e473f3e43
1 changed files with 2 additions and 2 deletions

View File

@ -2151,16 +2151,16 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
bi->biWidth, bi->biHeight, bi->biPlanes, bi->biBitCount, bi->biWidth, bi->biHeight, bi->biPlanes, bi->biBitCount,
bi->biSizeImage, bi->biClrUsed, usage == DIB_PAL_COLORS? "PAL" : "RGB"); bi->biSizeImage, bi->biClrUsed, usage == DIB_PAL_COLORS? "PAL" : "RGB");
effHeight = bi->biHeight >= 0 ? bi->biHeight : -bi->biHeight;
bm.bmType = 0; bm.bmType = 0;
bm.bmWidth = bi->biWidth; bm.bmWidth = bi->biWidth;
bm.bmHeight = bi->biHeight; bm.bmHeight = effHeight;
bm.bmWidthBytes = DIB_GetDIBWidthBytes(bm.bmWidth, bi->biBitCount); bm.bmWidthBytes = DIB_GetDIBWidthBytes(bm.bmWidth, bi->biBitCount);
bm.bmPlanes = bi->biPlanes; bm.bmPlanes = bi->biPlanes;
bm.bmBitsPixel = bi->biBitCount; bm.bmBitsPixel = bi->biBitCount;
bm.bmBits = NULL; bm.bmBits = NULL;
/* Get storage location for DIB bits */ /* Get storage location for DIB bits */
effHeight = bm.bmHeight >= 0 ? bm.bmHeight : -bm.bmHeight;
totalSize = bi->biSizeImage? bi->biSizeImage : bm.bmWidthBytes * effHeight; totalSize = bi->biSizeImage? bi->biSizeImage : bm.bmWidthBytes * effHeight;
if (section) if (section)