Merge pull request #35130 from qarmin/crash_item_bad_index

Don't allow to use too big index in ItemList
This commit is contained in:
Rémi Verschelde 2020-01-14 21:03:25 +01:00 committed by GitHub
commit 57986208f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -993,7 +993,7 @@ void ItemList::_notification(int p_what) {
}
//ensure_selected_visible needs to be checked before we draw the list.
if (ensure_selected_visible && current >= 0 && current <= items.size()) {
if (ensure_selected_visible && current >= 0 && current < items.size()) {
Rect2 r = items[current].rect_cache;
int from = scroll_bar->get_value();