fixed hb-shape-fuzzer failures in get_sid

This commit is contained in:
blueshade7 2019-11-16 19:47:31 -08:00 committed by Behdad Esfahbod
parent e26df436bc
commit 59fe379797
1 changed files with 3 additions and 2 deletions

View File

@ -545,8 +545,9 @@ struct Charset
}
}
hb_codepoint_t get_sid (hb_codepoint_t glyph) const
hb_codepoint_t get_sid (hb_codepoint_t glyph, unsigned int num_glyphs) const
{
if (unlikely (glyph >= num_glyphs)) return 0;
switch (format)
{
case 0: return u.format0.get_sid (glyph);
@ -1216,7 +1217,7 @@ struct cff1
hb_codepoint_t glyph_to_sid (hb_codepoint_t glyph) const
{
if (charset != &Null(Charset))
return charset->get_sid (glyph);
return charset->get_sid (glyph, num_glyphs);
else
{
hb_codepoint_t sid = 0;