[glyf] Adjust a check-range

This commit is contained in:
Behdad Esfahbod 2022-06-25 19:17:56 -06:00
parent db039d97ff
commit f897978f21
1 changed files with 1 additions and 1 deletions

View File

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