diff --git a/docs/changes.txt b/docs/changes.txt index c666ed9dbb..ffb05b5c70 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -87,6 +87,9 @@ Changes in behaviour not resulting in compilation errors there is no highlighted menu item, instead of wxID_ANY used before, for consistency with wxMSW. +- wxListCtrl::GetItemState() in wxMSW now checks the passed in item index for + validity, as the generic version under the other platforms already did. + Changes in behaviour which may result in build errors ----------------------------------------------------- diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 5f6f922854..89456899bb 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1077,6 +1077,9 @@ bool wxListCtrl::SetItem(long index, int col, const wxString& label, int imageId // Gets the item state int wxListCtrl::GetItemState(long item, long stateMask) const { + wxCHECK_MSG( item >= 0 && item < GetItemCount(), 0, + wxS("invalid list control item index in GetItemState()") ); + wxListItem info; info.m_mask = wxLIST_MASK_STATE;