Skip to content

Commit

Permalink
Add extra check in ListBox::selectChild()
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Mar 16, 2018
1 parent b8a8cca commit 7b49bf2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui/listbox.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Aseprite UI Library
// Copyright (C) 2001-2017 David Capello
// Copyright (C) 2001-2018 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
Expand Down Expand Up @@ -112,7 +112,8 @@ void ListBox::selectChild(Widget* item, Message* msg)
bool newState;

if (m_multiselect) {
newState = m_states[i];
ASSERT(i >= 0 && i < m_states.size());
newState = (i >= 0 && i < m_states.size() ? m_states[i]: false);

if (i >= MIN(itemIndex, m_firstSelectedIndex) &&
i <= MAX(itemIndex, m_firstSelectedIndex)) {
Expand Down

0 comments on commit 7b49bf2

Please sign in to comment.