From 77da448aff3029cc076b79536384651f61c25477 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Tue, 8 Apr 2008 00:31:44 +0000 Subject: [PATCH] Since we use C-style casts to grab the pointer from an item id, we can return an invalid item if the control has extra items appended. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/listctrl_mac.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index c1e28388c9..61f5f79049 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -1995,7 +1995,7 @@ wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem) const m_dbImpl->GetItemID( (DataBrowserTableViewRowIndex) row, &id ); // TODO: Use GetDataBrowserItemPartBounds to return if we are in icon or label - if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) ) + if ( !(GetWindowStyleFlag() & wxLC_VIRTUAL ) && row < GetItemCount() ) { wxMacListCtrlItem* lcItem; lcItem = (wxMacListCtrlItem*) id;