From 2a85f67341a751b83e89176d9e6ef3d4918a0af4 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 30 Apr 2026 23:22:10 +1000 Subject: [PATCH] FullscreenUI: Fix possible OOB on bad config --- src/core/fullscreenui_game_list.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/fullscreenui_game_list.cpp b/src/core/fullscreenui_game_list.cpp index a89f45f17..b4cdef67c 100644 --- a/src/core/fullscreenui_game_list.cpp +++ b/src/core/fullscreenui_game_list.cpp @@ -1037,7 +1037,8 @@ void FullscreenUI::HandleSelectDiscForDiscSet(const GameDatabase::DiscSetEntry* void FullscreenUI::SwitchToGameList() { s_game_list_locals.game_list_view = - static_cast(Core::GetBaseIntSettingValue("Main", "DefaultFullscreenUIGameView", 0)); + static_cast(std::min(Core::GetBaseUIntSettingValue("Main", "DefaultFullscreenUIGameView", 0), + static_cast(GameListView::Count) - 1)); s_game_list_locals.game_list_current_selection_path = {}; s_game_list_locals.game_list_current_selection_timeout = 0.0f;