From e2aeb7f3361b87e61a8bc5f478bb2dab056b1ac4 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 21 Sep 2024 09:08:40 +0200 Subject: render: xcursor_is_valid(): don't crash when there's no theme loaded When trying to set a custom cursor shape, we first validate it. This is done by checking against known server-side names, and then trying to load the cursor from the client side cursor theme. But, if we're using server side names, there is no theme loaded, and foot crashed. Fix by checking if we have a theme loaded, and if not, fail the cursor shape name validation. --- render.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'render.c') diff --git a/render.c b/render.c index 3d1ce4ee..20c0490b 100644 --- a/render.c +++ b/render.c @@ -4722,6 +4722,8 @@ render_xcursor_is_valid(const struct seat *seat, const char *cursor) { if (cursor == NULL) return false; + if (seat->pointer.theme == NULL) + return false; return wl_cursor_theme_get_cursor(seat->pointer.theme, cursor) != NULL; } -- cgit v1.3