From 7dd3abe69f6c48eb57391cc88932da49c02caac6 Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Tue, 15 Oct 2019 19:00:59 -0600 Subject: [PATCH] winex11: Copy icon color table in 256-color mode (Valgrind). Signed-off-by: Alex Henrie Signed-off-by: Alexandre Julliard --- dlls/winex11.drv/bitblt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 4eec3288e25..973af40c337 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -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] ); }