Yeah, I accidentally used the wrong tag (@bugfix) because of e. :)

Sorry.

--
Tom.

On 04/06/14 10:17, Tom Hacohen wrote:
> tasn pushed a commit to branch master.
>
> http://git.enlightenment.org/core/efl.git/commit/?id=3b70b4f28f9a5c0ab24181220501506d2e61871b
>
> commit 3b70b4f28f9a5c0ab24181220501506d2e61871b
> Author: Tom Hacohen <t...@stosb.com>
> Date:   Wed Jun 4 10:14:24 2014 +0100
>
>      Evas textblock: Fix crash when cutting ligatures with formats.
>
>      "f<color=#f00>i</color>f" could cause textblock to crash. It doesn't
>      crash anymore. It doesn't render the colours correctly either, but at
>      least this is the first step.
>
>      This is the start of fixing T1308
>
>      @bugfix
> ---
>   src/lib/evas/common/evas_text_utils.c | 4 ++++
>   src/tests/evas/evas_test_textblock.c  | 3 +++
>   2 files changed, 7 insertions(+)
>
> diff --git a/src/lib/evas/common/evas_text_utils.c 
> b/src/lib/evas/common/evas_text_utils.c
> index 2b43695..dc2407f 100644
> --- a/src/lib/evas/common/evas_text_utils.c
> +++ b/src/lib/evas/common/evas_text_utils.c
> @@ -180,6 +180,10 @@ evas_common_text_props_index_find(const Evas_Text_Props 
> *props, int _cutoff)
>      int max = props->len - 1;
>      int mid;
>
> +   /* Props can be empty, verify they are not before going on. */
> +   if (!props->info)
> +      return -1;
> +
>      _cutoff += props->text_offset;
>      ot_info = props->info->ot + props->start;
>      /* Should get us closer to the right place. */
> diff --git a/src/tests/evas/evas_test_textblock.c 
> b/src/tests/evas/evas_test_textblock.c
> index 4c48b60..d8949e2 100644
> --- a/src/tests/evas/evas_test_textblock.c
> +++ b/src/tests/evas/evas_test_textblock.c
> @@ -2612,6 +2612,9 @@ START_TEST(evas_textblock_formats)
>      evas_object_textblock_text_markup_prepend(cur, "<b></b>");
>      ck_assert_str_eq(evas_object_textblock_text_markup_get(tb), 
> "ab<b></b>c<br/>def");
>
> +   /* Ligatures cut by formats */
> +   evas_object_textblock_text_markup_set(tb, "f<color=#f00>i</color>f");
> +   evas_object_textblock_size_formatted_get(tb, NULL, NULL);
>
>      END_TB_TEST();
>   }
>



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their 
applications. Written by three acclaimed leaders in the field, 
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to