[glyf] Add an assertion

This commit is contained in:
Behdad Esfahbod 2022-06-27 14:02:15 -06:00
parent 5da341ce92
commit 6e72c2e3fa
1 changed files with 1 additions and 0 deletions

View File

@ -157,6 +157,7 @@ struct SimpleGlyph
{
const HBUINT16 *endPtsOfContours = &StructAfter<HBUINT16> (header);
int num_contours = header.numberOfContours;
assert (num_contours);
if (unlikely (!bytes.check_range (&endPtsOfContours[num_contours - 1]))) return false;
unsigned int num_points = endPtsOfContours[num_contours - 1] + 1;