Fix row validity check in MacHandleSelectionChange()

Valid indices must be in [0, count[ half-open interval.
This commit is contained in:
Vadim Zeitlin
2018-06-30 23:17:37 +02:00
parent f51cb52004
commit 30c798b70a

View File

@@ -439,7 +439,7 @@ void wxListBox::MacHandleSelectionChange(int row)
// Otherwise call DoChangeSingleSelection so GetOldSelection() will return
// the correct value if row < 0 later.
const int count = static_cast<int>(GetCount());
if ( row < 0 || row > count )
if ( row < 0 || row >= count )
{
if ( !m_oldSelections.empty() )
{