[glyf] Protect against an unlikely overflow

This commit is contained in:
Behdad Esfahbod 2022-06-27 12:55:13 -06:00
parent 8537d68172
commit 2e9dbdcbbe
1 changed files with 1 additions and 0 deletions

View File

@ -171,6 +171,7 @@ struct SimpleGlyph
const HBUINT8 *p = &StructAtOffset<HBUINT8> (&endPtsOfContours[num_contours + 1],
endPtsOfContours[num_contours]);
if (unlikely ((const char *) p < bytes.arrayZ)) return false; /* Unlikely overflow */
const HBUINT8 *end = (const HBUINT8 *) (bytes.arrayZ + bytes.length);
/* Read flags */