From 4c59533fadd271da9b062d1aad5d133526b5af55 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 25 Mar 2025 17:39:04 +0800 Subject: [PATCH] fix:avoid to set error size to buffer --- maomao.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/maomao.c b/maomao.c index b4c35cbf..90e80236 100644 --- a/maomao.c +++ b/maomao.c @@ -4206,6 +4206,15 @@ void scene_buffer_apply_opacity(struct wlr_scene_buffer *buffer, int sx, int sy, void scene_buffer_apply_size(struct wlr_scene_buffer *buffer, int sx, int sy, void *data) { animationScale *scale_data = (animationScale *)data; + + if(scale_data->height_scale <= 0 || scale_data->width_scale <= 0) { + return; + } + + if(scale_data->height <= 0 || scale_data->width <= 0) { + return; + } + struct wlr_scene_surface *surface = wlr_scene_surface_try_from_buffer(buffer); if (wlr_subsurface_try_from_wlr_surface(surface->surface) != NULL) { wlr_scene_buffer_set_dest_size(