From 47e7a1800fba9b8bf042a1f4976a15ab012ebfc7 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 10 Mar 2017 13:23:02 -0800 Subject: [PATCH] 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. --- src/hb-ot-layout-gsubgpos-private.hh | 7 ++++--- .../5bbf3712e6f79775c66a4407837a90e591efbef2.ttf | Bin 6400 -> 0 bytes test/shaping/tests/context-matching.tests | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 test/shaping/fonts/sha1sum/5bbf3712e6f79775c66a4407837a90e591efbef2.ttf diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 005ed21d8..f9fcec52b 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 2d2bf19b16ff4a4d7c9f4bf0630a4b46167bd048..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6400 zcmc&ZcQl;aw=>aWOa>7pBbkv&T!}6OL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=BjD(0@%lvAYY zAKJa-shSf$A9j{x_*>AT6bZi((&LQK8${*pwNuh_rkv6ncivvDgx*uTo?KHe(H6w^ zlO^E4zcSzKN>KdDzFKbaTKw}@DS-c{b}kRF^Z%mUn%}S5{%Ze(LG_ox*%<|D%?C3P zpfPx# diff --git a/test/shaping/tests/context-matching.tests b/test/shaping/tests/context-matching.tests index 1711818c0..e20616e4c 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]