From: Baptiste DURAND Date: Thu, 16 Jan 2014 15:56:13 +0000 (+0100) Subject: TIVI-2144 : Fix Segfault during popup process creation X-Git-Tag: accepted/tizen/generic/20140117.074918^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Fedje.git;a=commitdiff_plain;h=a7d4e1ec6c0b973431b56b6a92bb960a2ee09693 TIVI-2144 : Fix Segfault during popup process creation Add pointer test to allow the function call _edje_part_recalc_single_textblock with null args -> backport test pointer from current EFL version (1.8.4) Change-Id: Ie7d183110075f6f32936cb66203e2a16976e9aca Signed-off-by: Baptiste DURAND --- diff --git a/src/lib/edje_calc.c b/src/lib/edje_calc.c index db9ab1d..5a36b8b 100644 --- a/src/lib/edje_calc.c +++ b/src/lib/edje_calc.c @@ -1259,11 +1259,12 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, &ins_r, &ins_t, &ins_b); mw = ins_l + tw + ins_r; mh = ins_t + th + ins_b; - if (chosen_desc->text.min_x) + + if (minw && chosen_desc->text.min_x) { if (mw > *minw) *minw = mw; } - if (chosen_desc->text.min_y) + if (minh && chosen_desc->text.min_y) { if (mh > *minh) *minh = mh; } @@ -1285,15 +1286,16 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, &ins_t, &ins_b); mw = ins_l + tw + ins_r; mh = ins_t + th + ins_b; - if (chosen_desc->text.max_x) + + if (maxw && chosen_desc->text.max_x) { if (mw > *maxw) *maxw = mw; - if (*maxw < *minw) *maxw = *minw; + if (minw && (*maxw < *minw)) *maxw = *minw; } - if (chosen_desc->text.max_y) + if (maxh && chosen_desc->text.max_y) { - if (mh > *maxw) *maxh = mh; - if (*maxh < *minh) *maxh = *minh; + if (mh > *maxh) *maxh = mh; + if (minh && (*maxh < *minh)) *maxh = *minh; } } if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y))