From dc4762a69ae289ec18fec80bcb9fbaa28e918940 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 21 Jul 2020 19:33:05 +0530 Subject: [PATCH] Dont crash if Wayland returns a cursor image array with some null images --- glfw/wl_window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 3be5cfe73..13c1ba02e 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -77,6 +77,8 @@ setCursorImage(_GLFWwindow* window) return; if (cursorWayland->currentImage >= cursorWayland->cursor->image_count) cursorWayland->currentImage = 0; image = cursorWayland->cursor->images[cursorWayland->currentImage]; + if (!image) image = cursorWayland->cursor->images[0]; + if (!image) return; buffer = wl_cursor_image_get_buffer(image); if (image->delay && window->cursor) { changeTimerInterval(&_glfw.wl.eventLoopData, _glfw.wl.cursorAnimationTimer, ms_to_monotonic_t(image->delay));