diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 5dbc1b9225a..c5d192df966 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -223,7 +223,7 @@ static int get_dib_width_bytes( int width, int depth ) */ static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) { - int colors; + int colors, masks = 0; if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { @@ -239,7 +239,8 @@ static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse ) colors = 256; if (!colors && (info->bmiHeader.biBitCount <= 8)) colors = 1 << info->bmiHeader.biBitCount; - return sizeof(BITMAPINFOHEADER) + colors * + if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3; + return sizeof(BITMAPINFOHEADER) + masks * sizeof(DWORD) + colors * ((coloruse == DIB_RGB_COLORS) ? sizeof(RGBQUAD) : sizeof(WORD)); } }