From fdca3d51603bd6bef6a4b0ee4a560f7dcd2f1d37 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 20 May 2010 17:46:20 +0100 Subject: [PATCH] Fix alternate off-by-one --- src/hb-ot-layout-gsub-private.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index fae99d5..4c1b168 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -287,7 +287,7 @@ struct AlternateSubstFormat1 return false; unsigned int shift = _hb_ctz (lookup_mask); - unsigned int alt_index = (lookup_mask & glyph_mask) >> shift; + unsigned int alt_index = ((lookup_mask & glyph_mask) >> shift) - 1; if (unlikely (alt_index >= alt_set.len)) return false; -- 2.7.4