From 6e72c2e3faf84634ac98d31be2344c2d604bed14 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 27 Jun 2022 14:02:15 -0600 Subject: [PATCH] [glyf] Add an assertion --- src/OT/glyf/SimpleGlyph.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OT/glyf/SimpleGlyph.hh b/src/OT/glyf/SimpleGlyph.hh index 338a63050..f09fda1cb 100644 --- a/src/OT/glyf/SimpleGlyph.hh +++ b/src/OT/glyf/SimpleGlyph.hh @@ -157,6 +157,7 @@ struct SimpleGlyph { const HBUINT16 *endPtsOfContours = &StructAfter (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;