diff --git a/glfw/wl_client_side_decorations.c b/glfw/wl_client_side_decorations.c index e16f000ef..a5cf896a2 100644 --- a/glfw/wl_client_side_decorations.c +++ b/glfw/wl_client_side_decorations.c @@ -702,7 +702,7 @@ set_cursor(GLFWCursorShape shape, _GLFWwindow* window) struct wl_cursor_theme *theme = glfw_wlc_theme_for_scale(scale); if (!theme) return; cursor = _glfwLoadCursor(shape, theme); - if (!cursor) return; + if (!cursor || !cursor->images) return; image = cursor->images[0]; if (!image) return; if (image->width % scale || image->height % scale) { diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 210e365a7..ae5271950 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -251,8 +251,7 @@ setCursorImage(_GLFWwindow* window, bool on_theme_change) { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: late cursor load failed; proceeding with existing cursor"); } } - if (!cursorWayland->cursor || !cursorWayland->cursor->image_count) - return; + if (!cursorWayland->cursor || !cursorWayland->cursor->image_count || !cursorWayland->cursor->images) return; if (cursorWayland->currentImage >= cursorWayland->cursor->image_count) cursorWayland->currentImage = 0; image = cursorWayland->cursor->images[cursorWayland->currentImage]; if (!image) image = cursorWayland->cursor->images[0];