From 8a0fec1a867440a6e2c29fa888f71d93aa7f9093 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Sat, 24 Sep 2011 13:37:24 +0000 Subject: [PATCH] [User32] Check return value of DIB_GetBitmapInfo. svn path=/trunk/; revision=53836 --- reactos/dll/win32/user32/windows/cursoricon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/user32/windows/cursoricon.c b/reactos/dll/win32/user32/windows/cursoricon.c index cfc4baf025f..59d1ce047d7 100644 --- a/reactos/dll/win32/user32/windows/cursoricon.c +++ b/reactos/dll/win32/user32/windows/cursoricon.c @@ -1703,13 +1703,13 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name, else new_height = height; - if(bm_type == 0) + if (bm_type == 0) { BITMAPCOREHEADER *core = (BITMAPCOREHEADER *)&scaled_info->bmiHeader; core->bcWidth = new_width; core->bcHeight = new_height; } - else + else if (bm_type == 1) { /* Some sanity checks for BITMAPINFO (not applicable to BITMAPCOREINFO) */ if (info->bmiHeader.biHeight > 65535 || info->bmiHeader.biWidth > 65535) { @@ -1720,6 +1720,8 @@ static HBITMAP BITMAP_Load( HINSTANCE instance, LPCWSTR name, scaled_info->bmiHeader.biWidth = new_width; scaled_info->bmiHeader.biHeight = new_height; } + else + goto end; if (new_height < 0) new_height = -new_height;