Return false if index is out of bounds in GetItemT.

This commit is contained in:
Vitaliy Margolen 2005-11-17 11:06:18 +00:00 committed by Alexandre Julliard
parent 82f403bd66
commit def2bb6798
1 changed files with 3 additions and 4 deletions

View File

@ -813,11 +813,10 @@ HEADER_GetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
if (phdi->mask == 0)
return TRUE;
if ((nItem < 0) || (nItem >= (INT)infoPtr->uNumItem))
lpItem = NULL;
else
lpItem = &infoPtr->items[nItem];
return FALSE;
lpItem = &infoPtr->items[nItem];
if (phdi->mask & HDI_BITMAP)
phdi->hbm = (lpItem != NULL) ? lpItem->hbm : 0;