Merge pull request #162 from gmriggs/canary_experimental

fix array index out of bounds crash in EmulatorWindow::ProcessControllerHotkey
This commit is contained in:
chrisps 2023-05-20 09:55:43 -04:00 committed by GitHub
commit ad2d27f6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1304,8 +1304,9 @@ EmulatorWindow::ControllerHotKey EmulatorWindow::ProcessControllerHotkey(
break; break;
} }
if (button_combination.function == ButtonFunctions::IncTitleSelect || if ((button_combination.function == ButtonFunctions::IncTitleSelect ||
button_combination.function == ButtonFunctions::DecTitleSelect) { button_combination.function == ButtonFunctions::DecTitleSelect) &&
recently_launched_titles_.size() > 0) {
selected_title_index = std::clamp( selected_title_index = std::clamp(
selected_title_index, 0, (int)recently_launched_titles_.size() - 1); selected_title_index, 0, (int)recently_launched_titles_.size() - 1);