diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 62afa3d42a1..8f6f9ce7b50 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -1330,7 +1330,7 @@ static HICON CURSORICON_LoadFromFile( LPCWSTR filename, } dir = (const CURSORICONFILEDIR*) bits; - if ( filesize < (sizeof(*dir) + sizeof(dir->idEntries[0])*(dir->idCount-1)) ) + if ( filesize < FIELD_OFFSET( CURSORICONFILEDIR, idEntries[dir->idCount] )) goto end; if ( fCursor )