1
0
Fork 0

wayland/surface: Check buffer size also for role-less surfaces

The Wayland protocol spec doesn't say anything about this being required
only for surfaces with a role.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3463>
This commit is contained in:
Michel Dänzer 2023-12-18 18:15:22 +01:00 committed by Marge Bot
parent 7649e2f3ab
commit 98c8c03729

View file

@ -922,7 +922,7 @@ meta_wayland_surface_commit (MetaWaylandSurface *surface)
if ((meta_multi_texture_get_width (committed_texture) % committed_scale != 0) ||
(meta_multi_texture_get_height (committed_texture) % committed_scale != 0))
{
if (surface->role && !META_IS_WAYLAND_CURSOR_SURFACE (surface->role))
if (!surface->role || !META_IS_WAYLAND_CURSOR_SURFACE (surface->role))
{
wl_resource_post_error (surface->resource, WL_SURFACE_ERROR_INVALID_SIZE,
"Buffer size (%dx%d) must be an integer multiple "