Author: tkreuzer
Date: Wed Mar 25 22:37:16 2015
New Revision: 66892
URL:
http://svn.reactos.org/svn/reactos?rev=66892&view=rev
Log:
[WIN32K]
Handle DIB_PAL_INDICES in DIB_BitmapInfoSize
Modified:
trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/dibobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/dibobj.c…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/dibobj.c [iso-8859-1] Wed Mar 25 22:37:16 2015
@@ -1916,13 +1916,17 @@
INT FASTCALL DIB_BitmapInfoSize(const BITMAPINFO * info, WORD coloruse)
{
unsigned int colors, size, masks = 0;
+ unsigned int colorsize;
+
+ colorsize = (coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) :
+ (coloruse == DIB_PAL_INDICES) ? 0 :
+ sizeof(WORD);
if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER))
{
const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)info;
colors = (core->bcBitCount <= 8) ? 1 << core->bcBitCount : 0;
- return sizeof(BITMAPCOREHEADER) + colors *
- ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBTRIPLE) : sizeof(WORD));
+ return sizeof(BITMAPCOREHEADER) + colors * colorsize;
}
else /* Assume BITMAPINFOHEADER */
{
@@ -1932,7 +1936,7 @@
colors = 1 << info->bmiHeader.biBitCount;
if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3;
size = max( info->bmiHeader.biSize, sizeof(BITMAPINFOHEADER) + masks *
sizeof(DWORD) );
- return size + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) :
sizeof(WORD));
+ return size + colors * colorsize;
}
}