From: Carsten Haitzler (Rasterman) Date: Fri, 26 Apr 2013 07:28:27 +0000 (+0900) Subject: protect against failure to find a container layer win in comp X-Git-Tag: submit/efl/20131021.015651~737 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8cf7e6174423aca6764581cccda5fb921f8123a6;p=platform%2Fupstream%2Fenlightenment.git protect against failure to find a container layer win in comp it may happen that a container layer window cannot be found (someone deleted it other than e - which is possible), and e hasn't expected this. comp will have removed the comp win entry but containers will not know. this is either some client being stupid, or malicious, but protect against it, complain with an ERR and march on so we don't crash. --- diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index 4ced3ce..cde8c6c 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -5388,10 +5388,18 @@ e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Laye con = eina_list_data_get(c->man->containers); cwn = e_comp_win_find(con->layers[0].win); - cwn->stack_below = eina_list_append(cwn->stack_below, cw); - cw->cw_above = cwn; - c->wins = eina_inlist_remove(c->wins, EINA_INLIST_GET(cw)); - c->wins = eina_inlist_prepend_relative(c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cwn)); + if (!cwn) + { + ERR("Major error. Cannot find container layer 0 window marker"); + c->wins = eina_inlist_prepend(c->wins, EINA_INLIST_GET(cw)); + } + else + { + cwn->stack_below = eina_list_append(cwn->stack_below, cw); + cw->cw_above = cwn; + c->wins = eina_inlist_remove(c->wins, EINA_INLIST_GET(cw)); + c->wins = eina_inlist_prepend_relative(c->wins, EINA_INLIST_GET(cw), EINA_INLIST_GET(cwn)); + } } } if (stack == E_COMP_CANVAS_STACK_ABOVE)