[subset] Fix bound check when setting overlap bit.
length() shouldn't be used again as the end of instruction offset is already included in flags_offset.
This commit is contained in:
parent
10a20be397
commit
94ba4d5a44
|
@ -595,7 +595,7 @@ struct glyf
|
||||||
if (unlikely (!header.numberOfContours)) return;
|
if (unlikely (!header.numberOfContours)) return;
|
||||||
|
|
||||||
unsigned flags_offset = length (instructions_length ());
|
unsigned flags_offset = length (instructions_length ());
|
||||||
if (unlikely (length (flags_offset + 1) > bytes.length)) return;
|
if (unlikely (flags_offset + 1 > bytes.length)) return;
|
||||||
|
|
||||||
HBUINT8 &first_flag = (HBUINT8 &) StructAtOffset<HBUINT16> (&bytes, flags_offset);
|
HBUINT8 &first_flag = (HBUINT8 &) StructAtOffset<HBUINT16> (&bytes, flags_offset);
|
||||||
first_flag = (uint8_t) first_flag | FLAG_OVERLAP_SIMPLE;
|
first_flag = (uint8_t) first_flag | FLAG_OVERLAP_SIMPLE;
|
||||||
|
|
Loading…
Reference in New Issue