comctl32/listview: Do not try to invalidate for invalid item indices.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-03-09 19:53:14 +03:00 committed by Alexandre Julliard
parent 76f135e599
commit 74d24b2197
1 changed files with 3 additions and 1 deletions

View File

@ -1727,7 +1727,9 @@ static inline void LISTVIEW_InvalidateItem(const LISTVIEW_INFO *infoPtr, INT nIt
{ {
RECT rcBox; RECT rcBox;
if(!is_redrawing(infoPtr)) return; if (!is_redrawing(infoPtr) || nItem < 0 || nItem >= infoPtr->nItemCount)
return;
LISTVIEW_GetItemBox(infoPtr, nItem, &rcBox); LISTVIEW_GetItemBox(infoPtr, nItem, &rcBox);
LISTVIEW_InvalidateRect(infoPtr, &rcBox); LISTVIEW_InvalidateRect(infoPtr, &rcBox);
} }