TIVI-2144 : Fix Segfault during popup process creation 68/15068/4 accepted/tizen/generic accepted/tizen/ivi/stable accepted/tizen_generic accepted/tizen_ivi accepted/tizen_ivi_panda accepted/tizen_ivi_release tizen tizen_ivi_release accepted/tizen/generic/20140117.074918 accepted/tizen/generic/20140312.100441 accepted/tizen/ivi/20140117.182310 accepted/tizen/ivi/panda/20140312.110856 accepted/tizen/ivi/release/20140312.124146 submit/tizen/20140116.170845 submit/tizen/20140312.070748 submit/tizen_ivi_release/20140312.071222
authorBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Thu, 16 Jan 2014 15:56:13 +0000 (16:56 +0100)
committerBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Thu, 16 Jan 2014 15:59:55 +0000 (16:59 +0100)
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 <baptiste.durand@open.eurogiciel.org>
src/lib/edje_calc.c

index db9ab1d..5a36b8b 100644 (file)
@@ -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))