From b000b3bcc94e4e3d8f92f2f33105722b8c5bb7dc Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 5 Jun 2024 08:17:17 +0900 Subject: [PATCH] e_pixmap: check if cp->client is null Check this null validataion at the front of the function. Change-Id: If29787c21b521f12346a4011ed86e8285dcff6a2 --- src/bin/core/e_pixmap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bin/core/e_pixmap.c b/src/bin/core/e_pixmap.c index 62e5a39..68b69ff 100644 --- a/src/bin/core/e_pixmap.c +++ b/src/bin/core/e_pixmap.c @@ -584,6 +584,7 @@ e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache) EINTERN Eina_Bool e_pixmap_image_refresh(E_Pixmap *cp) { + E_Client *ec; E_Comp_Wl_Buffer *buffer = NULL; struct wl_shm_buffer *shm_buffer = NULL; int bw, bh; @@ -595,6 +596,9 @@ e_pixmap_image_refresh(E_Pixmap *cp) return EINA_FALSE; } + ec = cp->client; + EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE); + if (cp->dirty) { ELOGF("PIXMAP", "cp->dirty is set, cp:%p", NULL, cp); @@ -607,7 +611,7 @@ e_pixmap_image_refresh(E_Pixmap *cp) return EINA_FALSE; } - if ((cp->client) && (e_comp_object_render_update_lock_get(cp->client->frame))) + if (e_comp_object_render_update_lock_get(ec->frame)) { ELOGF("PIXMAP", "Render update locked, cp:%p", NULL, cp); return EINA_FALSE; @@ -672,7 +676,7 @@ e_pixmap_image_refresh(E_Pixmap *cp) * managed and be pending if previous buffer is not rendered yet. */ /* set size of image object to new buffer size */ e_pixmap_size_get(cp, &bw, &bh); - e_comp_object_size_update(cp->client->frame, bw, bh); + e_comp_object_size_update(ec->frame, bw, bh); } else if (buffer->type == E_COMP_WL_BUFFER_TYPE_TBM) { @@ -689,7 +693,7 @@ e_pixmap_image_refresh(E_Pixmap *cp) * managed and be pending if previous buffer is not rendered yet. */ /* set size of image object to new buffer size */ e_pixmap_size_get(cp, &bw, &bh); - e_comp_object_size_update(cp->client->frame, bw, bh); + e_comp_object_size_update(ec->frame, bw, bh); /* buffer has no client resources */ return EINA_TRUE; -- 2.7.4