wayland: Be more careful when loading cursors

Make sure we don't access the cursor_images array out of bounds.

Related: #6234
This commit is contained in:
Matthias Clasen
2023-11-27 14:53:51 -05:00
parent 7e1e11e280
commit 2b5a6963e4

View File

@ -220,7 +220,7 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
{ {
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor); GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
if (wayland_cursor->wl_cursor) if (wayland_cursor->wl_cursor && wayland_cursor->wl_cursor->image_count > 0)
{ {
struct wl_cursor_image *image; struct wl_cursor_image *image;
int cursor_scale; int cursor_scale;