cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4d8fbd623cfe8c8a30149cb383b69cc3a2eae44d

commit 4d8fbd623cfe8c8a30149cb383b69cc3a2eae44d
Author: Subhransu Sekhar Mohanty <sub.moha...@samsung.com>
Date:   Sat Mar 15 19:55:38 2014 +0900

    evas: add NULL check to avoid crash when clipper dosen't have a layer.
    
    Summary:
    There is a crash in naviframe demo and the stack points to the clip set 
function where it tries to acess evas object
    from a NULL layer , by going through the log found out raster has already 
added the NULL check in clip_unset function
    so just added the check in clip_set.
    
    Reviewers: seoz, raster
    
    CC: cedric
    
    Differential Revision: https://phab.enlightenment.org/D625
---
 src/lib/evas/canvas/evas_clip.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 01d2ede..33c2d6f 100644
--- a/src/lib/evas/canvas/evas_clip.c
+++ b/src/lib/evas/canvas/evas_clip.c
@@ -264,14 +264,19 @@ _evas_object_clip_set(Eo *eo_obj, 
Evas_Object_Protected_Data *obj, Evas_Object *
                   state_write->have_clipees = 0;
                }
              EINA_COW_STATE_WRITE_END(obj->cur->clipper, state_write, cur);
-
-             e = obj->cur->clipper->layer->evas;
-             if (obj->cur->clipper->cur->visible)
-               evas_damage_rectangle_add(e->evas,
-                                         obj->cur->clipper->cur->geometry.x + 
e->framespace.x,
-                                         obj->cur->clipper->cur->geometry.y + 
e->framespace.y,
-                                         obj->cur->clipper->cur->geometry.w,
-                                         obj->cur->clipper->cur->geometry.h);
+             
+             if ((obj->cur->clipper->cur) && (obj->cur->clipper->cur->visible))
+               {
+                  if (obj->cur->clipper->layer)
+                    {
+                       e = obj->cur->clipper->layer->evas;
+                       evas_damage_rectangle_add(e->evas,
+                                                 
obj->cur->clipper->cur->geometry.x + e->framespace.x,
+                                                 
obj->cur->clipper->cur->geometry.y + e->framespace.y,
+                                                 
obj->cur->clipper->cur->geometry.w,
+                                                 
obj->cur->clipper->cur->geometry.h);
+                    }
+               }
           }
         evas_object_change(obj->cur->clipper->object, obj->cur->clipper);
         evas_object_change(eo_obj, obj);

-- 


Reply via email to