scaled-scene-buffer: guard against negative sizes

This commit is contained in:
tokyo4j 2025-05-18 00:07:48 +09:00 committed by Hiroaki Yamamoto
parent 6305cc0f78
commit 849fd7a96f
4 changed files with 13 additions and 2 deletions

View file

@ -79,6 +79,9 @@ struct scaled_icon_buffer *
scaled_icon_buffer_create(struct wlr_scene_tree *parent, struct server *server,
int width, int height)
{
assert(parent);
assert(width >= 0 && height >= 0);
struct scaled_scene_buffer *scaled_buffer = scaled_scene_buffer_create(
parent, &impl, /* drop_buffer */ true);
struct scaled_icon_buffer *self = znew(*self);