Signed-off-by: Nikolay Sivov nsivov@codeweavers.com ---
Invalidation in LVM_SETITEM/LVM_SETITEMSTATE handlers could end up using item index that is no longer valid, leading to assertion. That could happen if item state change notification handler removes items.
dlls/comctl32/listview.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 4a2df808ad..d63c23a659 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -1727,7 +1727,9 @@ static inline void LISTVIEW_InvalidateItem(const LISTVIEW_INFO *infoPtr, INT nIt { RECT rcBox;
- if(!is_redrawing(infoPtr)) return; + if (!is_redrawing(infoPtr) || nItem < 0 || nItem >= infoPtr->nItemCount) + return; + LISTVIEW_GetItemBox(infoPtr, nItem, &rcBox); LISTVIEW_InvalidateRect(infoPtr, &rcBox); }