From 402b86f2a88b5ee3e112dbde2ec232ee5f36572f Mon Sep 17 00:00:00 2001 From: Aleksey Rybalkin Date: Sun, 15 Aug 2021 14:41:56 +0300 Subject: [PATCH] waylandevents: prevent segfault if xkb compose table is not found this can happen e.g. on pure wayland system where there is no X11 locales for xkbcommon to find. --- src/video/wayland/SDL_waylandevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index c93dcc126..f021c3adc 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -793,7 +793,7 @@ keyboard_input_get_text(char text[8], const struct SDL_WaylandInput *input, uint } #endif - if (WAYLAND_xkb_compose_state_feed(input->xkb.compose_state, sym) == XKB_COMPOSE_FEED_ACCEPTED) { + if (input->xkb.compose_state && WAYLAND_xkb_compose_state_feed(input->xkb.compose_state, sym) == XKB_COMPOSE_FEED_ACCEPTED) { switch(WAYLAND_xkb_compose_state_get_status(input->xkb.compose_state)) { case XKB_COMPOSE_COMPOSING: *handled_by_ime = SDL_TRUE;