fixed hb-shape-fuzzer failures in get_sid
This commit is contained in:
parent
e26df436bc
commit
59fe379797
|
@ -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)
|
switch (format)
|
||||||
{
|
{
|
||||||
case 0: return u.format0.get_sid (glyph);
|
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
|
hb_codepoint_t glyph_to_sid (hb_codepoint_t glyph) const
|
||||||
{
|
{
|
||||||
if (charset != &Null(Charset))
|
if (charset != &Null(Charset))
|
||||||
return charset->get_sid (glyph);
|
return charset->get_sid (glyph, num_glyphs);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
hb_codepoint_t sid = 0;
|
hb_codepoint_t sid = 0;
|
||||||
|
|
Loading…
Reference in New Issue