mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 22:52:20 +00:00
render/vulkan: check size when creating shm texture
This commit is contained in:
parent
d55c175777
commit
3da6fac1f2
@ -390,6 +390,12 @@ static struct wlr_texture *vulkan_texture_from_pixels(
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (width > fmt->shm.max_extent.width || height > fmt->shm.max_extent.height) {
|
||||||
|
wlr_log(WLR_ERROR, "Texture is too large to upload (%"PRIu32"x%"PRIu32" > %"PRIu32"x%"PRIu32")",
|
||||||
|
width, height, fmt->shm.max_extent.width, fmt->shm.max_extent.height);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
struct wlr_vk_texture *texture = vulkan_texture_create(renderer, width, height);
|
struct wlr_vk_texture *texture = vulkan_texture_create(renderer, width, height);
|
||||||
if (texture == NULL) {
|
if (texture == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user