mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
viewporter: fix "has buffer" check
Previously, cases when a viewport source box was updated without attaching
a buffer weren't checked for correctness properly because the state's buffer
would be NULL. Use wlr_surface_state_has_buffer() instead.
(cherry picked from commit 072f6ed977)
This commit is contained in:
parent
19aaaff429
commit
0f040dfc38
1 changed files with 1 additions and 1 deletions
|
|
@ -160,7 +160,7 @@ static void viewport_handle_surface_client_commit(struct wl_listener *listener,
|
|||
return;
|
||||
}
|
||||
|
||||
if (state->viewport.has_src && state->buffer != NULL &&
|
||||
if (state->viewport.has_src && state->buffer_width > 0 && state->buffer_height > 0 &&
|
||||
!check_src_buffer_bounds(state)) {
|
||||
wl_resource_post_error(viewport->resource, WP_VIEWPORT_ERROR_OUT_OF_BUFFER,
|
||||
"source rectangle out of buffer bounds");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue