[glyf] Protect against an unlikely overflow
This commit is contained in:
parent
8537d68172
commit
2e9dbdcbbe
|
@ -171,6 +171,7 @@ struct SimpleGlyph
|
||||||
const HBUINT8 *p = &StructAtOffset<HBUINT8> (&endPtsOfContours[num_contours + 1],
|
const HBUINT8 *p = &StructAtOffset<HBUINT8> (&endPtsOfContours[num_contours + 1],
|
||||||
endPtsOfContours[num_contours]);
|
endPtsOfContours[num_contours]);
|
||||||
|
|
||||||
|
if (unlikely ((const char *) p < bytes.arrayZ)) return false; /* Unlikely overflow */
|
||||||
const HBUINT8 *end = (const HBUINT8 *) (bytes.arrayZ + bytes.length);
|
const HBUINT8 *end = (const HBUINT8 *) (bytes.arrayZ + bytes.length);
|
||||||
|
|
||||||
/* Read flags */
|
/* Read flags */
|
||||||
|
|
Loading…
Reference in New Issue