fix filebrowser crash caused when trying to select all files (L2) whilst a hidden file/folder exists.

this crash was found by @WE1ZARD.
to trigger it, press L2 in the filebrowser whilst a hidden file exists and the hide hidden is enabled.
the was due to GetEntry(i) internally using m_entries_current, and the select all was using the index from m_entries_current.
this would result in an index that goes oob, and as its a write, it crashes.
This commit is contained in:
ITotalJustice
2025-05-03 13:17:51 +01:00
parent d95226f8c0
commit df5e27dd06

View File

@@ -283,7 +283,7 @@ Menu::Menu(const std::vector<NroEntry>& nro_entries) : MenuBase{"FileBrowser"_i1
const auto set = m_selected_count != m_entries_current.size();
for (const auto& i : m_entries_current) {
for (u32 i = 0; i < m_entries_current.size(); i++) {
auto& e = GetEntry(i);
if (e.selected != set) {
e.selected = set;