[HarfBuzz] harfbuzz: Branch 'master' - 2 commits

Behdad Esfahbod behdad at kemper.freedesktop.org
Fri Mar 10 21:23:31 UTC 2017


 dev/null                                  |binary
 src/hb-buffer-serialize.cc                |    2 ++
 src/hb-ot-layout-gsubgpos-private.hh      |    7 ++++---
 test/shaping/tests/context-matching.tests |    1 -
 4 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 47e7a1800fba9b8bf042a1f4976a15ab012ebfc7
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Mar 10 13:23:02 2017 -0800

    Revert "Fix Context lookup application when moving back after a glyph delete"
    
    This reverts commit b9b005f3a44ccf78a45b212b126287b69b9f4b40.
    
    This introduced invalid access cases. Revert until I fix correctly.

diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh
index 005ed21..f9fcec5 100644
--- a/src/hb-ot-layout-gsubgpos-private.hh
+++ b/src/hb-ot-layout-gsubgpos-private.hh
@@ -1021,13 +1021,14 @@ static inline bool apply_lookup (hb_apply_context_t *c,
      */
 
     end += delta;
-    if (end < int (match_positions[idx]))
+    if (end <= int (match_positions[idx]))
     {
       /* End might end up being smaller than match_positions[idx] if the recursed
-       * lookup ended up removing too many items.
+       * lookup ended up removing many items, more than we have had matched.
        * Just never rewind end back and get out of here.
        * https://bugs.chromium.org/p/chromium/issues/detail?id=659496 */
       end = match_positions[idx];
+      /* There can't be any further changes. */
       break;
     }
 
@@ -1040,7 +1041,7 @@ static inline bool apply_lookup (hb_apply_context_t *c,
     }
     else
     {
-      /* NOTE: delta is non-positive. */
+      /* NOTE: delta is negative. */
       delta = MAX (delta, (int) next - (int) count);
       next -= delta;
     }
diff --git a/test/shaping/fonts/sha1sum/5bbf3712e6f79775c66a4407837a90e591efbef2.ttf b/test/shaping/fonts/sha1sum/5bbf3712e6f79775c66a4407837a90e591efbef2.ttf
deleted file mode 100644
index 2d2bf19..0000000
Binary files a/test/shaping/fonts/sha1sum/5bbf3712e6f79775c66a4407837a90e591efbef2.ttf and /dev/null differ
diff --git a/test/shaping/tests/context-matching.tests b/test/shaping/tests/context-matching.tests
index 1711818..e20616e 100644
--- a/test/shaping/tests/context-matching.tests
+++ b/test/shaping/tests/context-matching.tests
@@ -1,4 +1,3 @@
 fonts/sha1sum/4cce528e99f600ed9c25a2b69e32eb94a03b4ae8.ttf::U+1A48,U+1A58,U+1A25,U+1A48,U+1A58,U+1A25,U+1A6E,U+1A63:[uni1A48=0+1212|uni1A25=0+1912|uni1A58=0+0|uni1A48=3+1212|uni1A6E=3+0|uni1A25=3+1912|uni1A58=3+0|uni1A63=3+1212]
 fonts/sha1sum/d629e7fedc0b350222d7987345fe61613fa3929a.ttf::U+0915,U+093F,U+0915,U+093F:[ivowelsign03deva=0+530|kadeva=0+1561|ivowelsign03deva=2+530|kadeva=2+1561]
 fonts/sha1sum/f499fbc23865022234775c43503bba2e63978fe1.ttf::U+09B0,U+09CD,U+09A5,U+09CD,U+09AF,U+09C0:[gid1=0+1320|gid13=0+523|gid18=0+545]
-fonts/sha1sum/5bbf3712e6f79775c66a4407837a90e591efbef2.ttf:--font-funcs=ot:U+1F1FA,U+1F1FC:[gid3=0+2550]
commit 3c080a7a0aefec1e9620e3fb399ad280ea4ee5a2
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Tue Mar 7 18:13:28 2017 -0800

    Fix buffer serialize of empty buffer
    
    Ouch!

diff --git a/src/hb-buffer-serialize.cc b/src/hb-buffer-serialize.cc
index 63a0f34..85696c5 100644
--- a/src/hb-buffer-serialize.cc
+++ b/src/hb-buffer-serialize.cc
@@ -311,6 +311,8 @@ hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
   if (!buf_consumed)
     buf_consumed = &sconsumed;
   *buf_consumed = 0;
+  if (buf_size)
+    *buf = '\0';
 
   assert ((!buffer->len && buffer->content_type == HB_BUFFER_CONTENT_TYPE_INVALID) ||
 	  buffer->content_type == HB_BUFFER_CONTENT_TYPE_GLYPHS);


More information about the HarfBuzz mailing list