From 3fbf234b327ebe89e1979ae1d50a03ed05e4bb7d Mon Sep 17 00:00:00 2001 From: HyunSeok Cha Date: Fri, 20 Jan 2017 13:49:13 +0900 Subject: [PATCH] evas: Fix very unlikely crash in evas render During a stress test of EFL a seemingly impossible crash happened, where one of object's cow fields was NULL inside evas_object_was_visible. Nothing in the code flow can possibly lead to this situation but it still happened. For information, the object's delete_me flag was 2 in evas_object_is_active() called from _evas_render_phase1_object_process(). So let's add a small safety check for crash prevention. Differential Revision: https://phab.enlightenment.org/D4608 --- src/lib/evas/include/evas_inline.x | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index fdf91dd..6afa69a 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -46,6 +46,7 @@ _evas_object_callback_has_by_type(Evas_Object_Protected_Data *obj, Evas_Callback static inline int evas_object_was_visible(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { + if (EINA_UNLIKELY(!obj->prev)) return EINA_FALSE; if ((obj->prev->visible) && (!obj->no_render) && ((obj->prev->cache.clip.visible) || obj->is_smart) && ((obj->prev->cache.clip.a > 0 && obj->prev->render_op == EVAS_RENDER_BLEND) @@ -156,6 +157,7 @@ evas_object_is_source_invisible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro static inline int evas_object_is_visible(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { + if (EINA_UNLIKELY(!obj->cur)) return EINA_FALSE; if ((obj->cur->visible) && (!obj->no_render) && ((obj->cur->cache.clip.visible) || (obj->is_smart)) && ((obj->cur->cache.clip.a > 0 && obj->cur->render_op == EVAS_RENDER_BLEND) -- 2.7.4