From 85a93029a7f929ca8dbb8d272579bc0f2e9b6e1f Mon Sep 17 00:00:00 2001 From: gmriggs Date: Fri, 19 May 2023 15:26:19 -0400 Subject: [PATCH] fix array index out of bounds crash in EmulatorWindow::ProcessControllerHotkey --- src/xenia/app/emulator_window.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/xenia/app/emulator_window.cc b/src/xenia/app/emulator_window.cc index 90257d45d..2d6c11b92 100644 --- a/src/xenia/app/emulator_window.cc +++ b/src/xenia/app/emulator_window.cc @@ -1304,8 +1304,9 @@ EmulatorWindow::ControllerHotKey EmulatorWindow::ProcessControllerHotkey( break; } - if (button_combination.function == ButtonFunctions::IncTitleSelect || - button_combination.function == ButtonFunctions::DecTitleSelect) { + if ((button_combination.function == ButtonFunctions::IncTitleSelect || + button_combination.function == ButtonFunctions::DecTitleSelect) && + recently_launched_titles_.size() > 0) { selected_title_index = std::clamp( selected_title_index, 0, (int)recently_launched_titles_.size() - 1);