[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Oct 17 03:03:09 PDT 2013


 src/hb-buffer.cc                     |    7 ++++++-
 src/hb-ot-layout-gsubgpos-private.hh |    3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit da72042c52ed3cc0ee19d3eabb8db7c7dd34d3ed
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Oct 17 12:01:50 2013 +0200

    [otlayout] Fix up recent Context matching change
    
    Commit 6b65a76b40522a4f57a6fedcbdfc5a4d736f1d3c.  "end" was becoming
    negative.  Was trigerred by Lohit-Kannada 2.5.3 and the sequence:
    U+0CB0,U+200D,U+0CBE,U+0CB7,U+0CCD,U+0C9F,U+0CCD,U+0CB0,U+0C97,U+0CB3
    Two glyphs were being duplicated.

diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index b778abb..867438a 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -365,8 +365,12 @@ hb_buffer_t::move_to (unsigned int i)
   {
     assert (i <= len);
     idx = i;
+    return true;
   }
-  else if (out_len < i)
+
+  assert (i <= out_len + (len - idx));
+
+  if (out_len < i)
   {
     unsigned int count = i - out_len;
     if (unlikely (!make_room_for (count, count))) return false;
@@ -388,6 +392,7 @@ hb_buffer_t::move_to (unsigned int i)
     out_len -= count;
     memmove (info + idx, out_info + out_len, count * sizeof (out_info[0]));
   }
+
   return true;
 }
 
diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 5366550..fde6eae 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -1031,7 +1031,8 @@ static inline bool apply_lookup (hb_apply_context_t *c,
 
     /* Recursed lookup changed buffer len.  Adjust. */
 
-    end += delta;
+    /* end can't go back past the current match position. */
+    end = MAX ((int) match_positions[idx] + 1, int (end) + delta);
 
     unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */
 



More information about the HarfBuzz mailing list