Commit 7dd3abe6 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

winex11: Copy icon color table in 256-color mode (Valgrind).

parent 293dae8f
......@@ -924,13 +924,14 @@ static void free_ximage_bits( struct gdi_image_bits *bits )
XFree( bits->ptr );
}
/* only for use on sanitized BITMAPINFO structures */
static inline int get_dib_info_size( const BITMAPINFO *info, UINT coloruse )
{
if (info->bmiHeader.biCompression == BI_BITFIELDS)
return sizeof(BITMAPINFOHEADER) + 3 * sizeof(DWORD);
if (coloruse == DIB_PAL_COLORS)
return sizeof(BITMAPINFOHEADER) + info->bmiHeader.biClrUsed * sizeof(WORD);
if (!info->bmiHeader.biClrUsed && info->bmiHeader.biBitCount <= 8)
return FIELD_OFFSET( BITMAPINFO, bmiColors[1 << info->bmiHeader.biBitCount] );
return FIELD_OFFSET( BITMAPINFO, bmiColors[info->bmiHeader.biClrUsed] );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment