diff options
| author | 2021-12-14 23:42:07 -0500 | |
|---|---|---|
| committer | 2021-12-14 23:42:07 -0500 | |
| commit | f0ed11e3180f9d241881576ac2f62e50dddd7804 (patch) | |
| tree | d400260e24cde5fbea0144be468f288937ff5884 | |
| parent | Merge pull request #7583 from german77/triggered (diff) | |
| parent | qt_software_keyboard: Fix out of bounds array access (diff) | |
| download | yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar.gz yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.tar.xz yuzu-f0ed11e3180f9d241881576ac2f62e50dddd7804.zip | |
Merge pull request #7579 from Morph1984/swkbd-oob-array-access
qt_software_keyboard: Fix out of bounds array access
Diffstat (limited to '')
| -rw-r--r-- | src/yuzu/applets/qt_software_keyboard.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/yuzu/applets/qt_software_keyboard.cpp b/src/yuzu/applets/qt_software_keyboard.cpp index de7f98c4f..c3857fc98 100644 --- a/src/yuzu/applets/qt_software_keyboard.cpp +++ b/src/yuzu/applets/qt_software_keyboard.cpp | |||
| @@ -475,11 +475,26 @@ void QtSoftwareKeyboardDialog::open() { | |||
| 475 | row = 0; | 475 | row = 0; |
| 476 | column = 0; | 476 | column = 0; |
| 477 | 477 | ||
| 478 | const auto* const curr_button = | 478 | switch (bottom_osk_index) { |
| 479 | keyboard_buttons[static_cast<int>(bottom_osk_index)][row][column]; | 479 | case BottomOSKIndex::LowerCase: |
| 480 | case BottomOSKIndex::UpperCase: { | ||
| 481 | const auto* const curr_button = | ||
| 482 | keyboard_buttons[static_cast<std::size_t>(bottom_osk_index)][row][column]; | ||
| 483 | |||
| 484 | // This is a workaround for setFocus() randomly not showing focus in the UI | ||
| 485 | QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center())); | ||
| 486 | break; | ||
| 487 | } | ||
| 488 | case BottomOSKIndex::NumberPad: { | ||
| 489 | const auto* const curr_button = numberpad_buttons[row][column]; | ||
| 480 | 490 | ||
| 481 | // This is a workaround for setFocus() randomly not showing focus in the UI | 491 | // This is a workaround for setFocus() randomly not showing focus in the UI |
| 482 | QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center())); | 492 | QCursor::setPos(curr_button->mapToGlobal(curr_button->rect().center())); |
| 493 | break; | ||
| 494 | } | ||
| 495 | default: | ||
| 496 | break; | ||
| 497 | } | ||
| 483 | 498 | ||
| 484 | StartInputThread(); | 499 | StartInputThread(); |
| 485 | } | 500 | } |