diff --git a/reactos/win32ss/user/user32/windows/cursoricon.c b/reactos/win32ss/user/user32/windows/cursoricon.c index e14c401d3e6..f5a17acd49f 100644 --- a/reactos/win32ss/user/user32/windows/cursoricon.c +++ b/reactos/win32ss/user/user32/windows/cursoricon.c @@ -117,12 +117,12 @@ static int get_dib_image_size( int width, int height, int depth ) static BOOL is_dib_monochrome( const BITMAPINFO* info ) { - if (info->bmiHeader.biBitCount != 1) return FALSE; - if (info->bmiHeader.biSize == sizeof(BITMAPCOREHEADER)) { const RGBTRIPLE *rgb = ((const BITMAPCOREINFO*)info)->bmciColors; + if (((const BITMAPCOREINFO*)info)->bmciHeader.bcBitCount != 1) return FALSE; + /* Check if the first color is black */ if ((rgb->rgbtRed == 0) && (rgb->rgbtGreen == 0) && (rgb->rgbtBlue == 0)) { @@ -138,6 +138,8 @@ static BOOL is_dib_monochrome( const BITMAPINFO* info ) { const RGBQUAD *rgb = info->bmiColors; + if (info->bmiHeader.biBitCount != 1) return FALSE; + /* Check if the first color is black */ if ((rgb->rgbRed == 0) && (rgb->rgbGreen == 0) && (rgb->rgbBlue == 0) && (rgb->rgbReserved == 0))