Fix alternate off-by-one

This commit is contained in:
Behdad Esfahbod 2010-05-20 17:46:20 +01:00
parent b634beb39e
commit fdca3d5160
1 changed files with 1 additions and 1 deletions

View File

@ -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;