Evas font-ot: Fixed mistakes that caused ilegal reads.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:37:40 +0000 (10:37 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 30 Jan 2011 10:37:40 +0000 (10:37 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@56464 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/engines/common/evas_font_ot.c

index 96cedbd..06ad6b9 100644 (file)
@@ -73,12 +73,13 @@ evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_i
      {
         if (right_bound == (int) props->ot_data->len)
           {
-             items = orig_len - props->ot_data->items[left_bound].source_cluster;
+             items = orig_len -
+                props->ot_data->items[right_bound - 1].source_cluster;
           }
         else
           {
-             items = props->ot_data->items[right_bound - 1].source_cluster -
-                props->ot_data->items[right_bound].source_cluster;
+             items = props->ot_data->items[right_bound].source_cluster -
+                props->ot_data->items[right_bound - 1].source_cluster;
           }
      }
    return (items > 0) ? items : 1;