aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_linux_dmabuf_v1.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/types/wlr_linux_dmabuf_v1.c b/types/wlr_linux_dmabuf_v1.c
index 7b08b350..b111a721 100644
--- a/types/wlr_linux_dmabuf_v1.c
+++ b/types/wlr_linux_dmabuf_v1.c
@@ -204,6 +204,17 @@ static void params_create_common(struct wl_resource *params_resource,
goto err_out;
}
+ /* reject unknown flags */
+ uint32_t all_flags = ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT |
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED |
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST;
+ if (flags & ~all_flags) {
+ wl_resource_post_error(params_resource,
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT,
+ "Unknown dmabuf flags %"PRIu32, flags);
+ goto err_out;
+ }
+
attribs.width = width;
attribs.height = height;
attribs.format = format;
@@ -265,14 +276,6 @@ static void params_create_common(struct wl_resource *params_resource,
}
}
- /* reject unknown flags */
- if (attribs.flags & ~ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT) {
- wl_resource_post_error(params_resource,
- ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT,
- "Unknown dmabuf flags %"PRIu32, attribs.flags);
- goto err_out;
- }
-
/* Check if dmabuf is usable */
if (!check_import_dmabuf(linux_dmabuf, &attribs)) {
goto err_failed;