diff --git a/dlls/user/cursoricon.c b/dlls/user/cursoricon.c
index c089e4e..87e7b5d 100644
--- a/dlls/user/cursoricon.c
+++ b/dlls/user/cursoricon.c
@@ -1036,13 +1036,6 @@ static BOOL load_cursor_frame( LPBYTE bi
 
     bmi = (BITMAPINFO *)bits;
 
-    size = bitmap_info_size( bmi, DIB_RGB_COLORS );
-
-    if (!width) width = bmi->bmiHeader.biWidth;
-    if (!height) height = bmi->bmiHeader.biHeight/2;
-    DoStretch = (bmi->bmiHeader.biHeight/2 != height) ||
-      (bmi->bmiHeader.biWidth != width);
-
     /* Check bitmap header */
 
     if ( (bmi->bmiHeader.biSize != sizeof(BITMAPCOREHEADER)) &&
@@ -1053,6 +1046,13 @@ static BOOL load_cursor_frame( LPBYTE bi
           return FALSE;
     }
 
+    size = bitmap_info_size( bmi, DIB_RGB_COLORS );
+
+    if (!width) width = bmi->bmiHeader.biWidth;
+    if (!height) height = bmi->bmiHeader.biHeight/2;
+    DoStretch = (bmi->bmiHeader.biHeight/2 != height) ||
+      (bmi->bmiHeader.biWidth != width);
+
     if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL );
     if (screen_dc)
     {
