From ef948b4e6e93837a46a67caec513b794ffdf6c86 Mon Sep 17 00:00:00 2001 From: schellingb <14200249+schellingb@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:50:12 +0900 Subject: [PATCH] Limit keys accepted by the libretro keyboard callback to known keys (#524) --- dosbox_pure_libretro.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/dosbox_pure_libretro.cpp b/dosbox_pure_libretro.cpp index e87f111d..04008762 100644 --- a/dosbox_pure_libretro.cpp +++ b/dosbox_pure_libretro.cpp @@ -3278,6 +3278,7 @@ void retro_init(void) //#3 static void RETRO_CALLCONV keyboard_event(bool down, unsigned keycode, uint32_t character, uint16_t key_modifiers) { // This can be called from another thread. Hopefully we can get away without a mutex in DBP_QueueEvent. + if (keycode >= RETROK_LAST) return; int val = dbp_keymap_retro2dos[keycode]; if (!val) return; if (down && !dbp_keys_down[val])