Evas textblock: Skip layout logic for an text item which doesn't have font. 88/59188/3
authorYoungbok Shin <youngb.shin@samsung.com>
Fri, 4 Dec 2015 14:46:26 +0000 (14:46 +0000)
committerYoungbok Shin <youngb.shin@samsung.com>
Wed, 17 Feb 2016 08:22:58 +0000 (00:22 -0800)
Summary:
Evas textblock could cause infinite loop if there is no fonts to use.
If there is no fonts, text_props.text_len is never set.
When text_props.text_len is 0, the for loop in _layout_par runs forever.
It is ridiculous to use Textblock without fonts. But, it shouldn't runs
infinite loop in any situation.

@fix

Test Plan:
1. Remove all of fonts in your EFL or Tizen device.
   (Or you can test it modifying some codes in Textblock by skipping load fonts.)
2. Run elementary_test -to entry3 or see any multiline textblocks.

Reviewers: tasn, herdsman, woohyun

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3402

Change-Id: Ifeb027353a8b0de7ff033df63f02d542954c7cf7

src/lib/evas/canvas/evas_object_textblock.c

index ae6eeaf..e09a08e 100644 (file)
@@ -5171,7 +5171,8 @@ _layout_par(Ctxt *c)
 
         it = _ITEM(eina_list_data_get(i));
         /* Skip visually deleted items */
-        if (it->visually_deleted)
+        if (it->visually_deleted ||
+            ((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) && !it->format->font.font))
           {
              //one more chance for ellipsis special cases
              if (c->o->ellip_prev_it == i)