From 48bcb8d0b3d521809bfd597246bfc176f80d44e9 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 1 May 2020 15:12:16 +0100 Subject: [PATCH] e comp - shape rects - handle logic hol where num > 0 but rects is null don't fall in this hole and crash... --- src/bin/e_comp_object.c | 2 +- src/bin/e_comp_x.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index cb2af4391..1fdb46f17 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -3850,7 +3850,7 @@ e_comp_object_shape_apply(Evas_Object *obj) _e_comp_object_alpha_set(cw); return; } - if (cw->ec->shaped) + if ((cw->ec->shaped) && (cw->ec->shape_rects)) { unsigned char *spix, *sp; diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index 5eba41387..b385147b5 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -3309,7 +3309,7 @@ _e_comp_x_client_shape_rects_check(E_Client *ec, Ecore_X_Rectangle *rects, int n } } } - if (changed) + if ((changed) && (rects)) { E_FREE(ec->shape_rects); ec->shape_rects = (Eina_Rectangle*)rects; @@ -4323,6 +4323,7 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec) { ec->shaped = 1; E_FREE(ec->shape_rects); + ec->shape_rects_num = 0; E_FREE(ec->shape_input_rects); ec->shape_input_rects_num = 0; e_comp_object_frame_theme_set(ec->frame, E_COMP_OBJECT_FRAME_RESHADOW);