From 81741364a7f4e54e0a522c0e44e8f9cac32bdd83 Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Sun, 28 Sep 2025 23:04:16 +0100 Subject: [PATCH] homebrew: fix crashing due to using the wrong array size when scrolling. --- sphaira/source/ui/menus/homebrew.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sphaira/source/ui/menus/homebrew.cpp b/sphaira/source/ui/menus/homebrew.cpp index 258e89f..5493f36 100644 --- a/sphaira/source/ui/menus/homebrew.cpp +++ b/sphaira/source/ui/menus/homebrew.cpp @@ -85,7 +85,7 @@ void Menu::Update(Controller* controller, TouchInfo* touch) { } MenuBase::Update(controller, touch); - m_list->OnUpdate(controller, touch, m_index, m_entries.size(), [this](bool touch, auto i) { + m_list->OnUpdate(controller, touch, m_index, m_entries_current.size(), [this](bool touch, auto i) { if (touch && m_index == i) { FireAction(Button::A); } else { @@ -356,7 +356,7 @@ void Menu::Sort() { m_entries_current = m_entries_index[Filter_HideHidden]; } - std::sort(m_entries_current.begin(), m_entries_current.end(), sorter); + std::ranges::sort(m_entries_current, sorter); } void Menu::SortAndFindLastFile(bool scan) { @@ -398,6 +398,7 @@ void Menu::FreeEntries() { } m_entries.clear(); + m_entries_current = {}; for (auto& e : m_entries_index) { e.clear(); }