aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_clip.c
diff options
context:
space:
mode:
authorSubhransu Sekhar Mohanty <sub.mohanty@samsung.com>2014-03-15 19:55:38 +0900
committerCedric BAIL <cedric.bail@free.fr>2014-03-15 19:55:59 +0900
commit4d8fbd623cfe8c8a30149cb383b69cc3a2eae44d (patch)
treec3e8d18e395b6dbc164af1a2b21f21c89186bc54 /src/lib/evas/canvas/evas_clip.c
parentEvas textblock: Don't include right margin/padding twice when aligning lines. (diff)
downloadefl-4d8fbd623cfe8c8a30149cb383b69cc3a2eae44d.tar.gz
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
Diffstat (limited to 'src/lib/evas/canvas/evas_clip.c')
-rw-r--r--src/lib/evas/canvas/evas_clip.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c
index 01d2edecc0..33c2d6f1e6 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);