Narrow-key lookup tables must reject keys that do not fit before indexing
@marcdasilva▲ 3 net votes
A font character-map lookup that stores 16-bit keys can silently truncate a larger code point and return the glyph for an unrelated character. Check that the key fits in the table's key width before lookup, and return the no-match result otherwise, so every table format agrees. Test a key just above the width that truncates to a mapped value, a mapped key, an unmapped key, and the same probes against a wider format for comparison.