summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2015-11-04 13:58:58 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-11-04 13:58:59 +0900
commitaefcb11444f6172b10129967956f3e6bde4dca04 (patch)
treebfe8e859522863a88a0a15dc79db861c00f7b0c2
parent4ce59a4f0878ea7cff72ddad75706a47bae76fe4 (diff)
Evas Text: avoid SIGSEV while ellipsis recalculation
Summary: Fix Segmentation Fault when TEXT part getting resized and when it has some params (for example ellipsis). Fix T2640 @fix Test Plan: Refer to T2640 Reviewers: raster, Hermet, seoz, herdsman, cedric, reutskiy.v.v, NikaWhite Subscribers: stefan_schmidt, tasn, cedric Maniphest Tasks: T2640 Differential Revision: https://phab.enlightenment.org/D2944
-rw-r--r--src/lib/evas/canvas/evas_object_text.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c
index 3e3e9ffe97..c066a408d2 100644
--- a/src/lib/evas/canvas/evas_object_text.c
+++ b/src/lib/evas/canvas/evas_object_text.c
@@ -879,21 +879,27 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t
879 /* FIXME: We shouldn't do anything. */ 879 /* FIXME: We shouldn't do anything. */
880 } 880 }
881 881
882 int cut = ENFN->font_last_up_to_pos(ENDT, 882 /* In case when we reach end of itr list, and have NULL */
883 o->font, 883 int cut = -1;
884 &itr->text_props, 884 if (itr && (itr != end_ellip_it))
885 ellip_frame - (advance + l + r),
886 0);
887 if (cut >= 0)
888 { 885 {
889 end_ellip_it->text_pos = itr->text_pos + cut; 886 cut = ENFN->font_last_up_to_pos(ENDT,
890 end_ellip_it->visual_pos = itr->visual_pos + cut; 887 o->font,
891 if (_layout_text_item_trim(obj, o, itr, cut, EINA_TRUE)) 888 &itr->text_props,
889 ellip_frame - (advance + l + r),
890 0);
891 if (cut >= 0)
892 { 892 {
893 itr = (Evas_Object_Text_Item *) EINA_INLIST_GET(itr)->next; 893 end_ellip_it->text_pos = itr->text_pos + cut;
894 end_ellip_it->visual_pos = itr->visual_pos + cut;
895 if (_layout_text_item_trim(obj, o, itr, cut, EINA_TRUE))
896 {
897 itr = (Evas_Object_Text_Item *) EINA_INLIST_GET(itr)->next;
898 }
894 } 899 }
895 } 900 }
896 901
902
897 /* Remove the rest of the items */ 903 /* Remove the rest of the items */
898 while (itr) 904 while (itr)
899 { 905 {