From 2f9945ca0191c316fa82c1fb5fa553bc4aa50b0c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 2 May 2023 11:33:31 -0600 Subject: [PATCH] [Glyph] Only treat numContours=-1 as Composite Leave the other negative numbers as empty glyph. --- src/OT/glyf/Glyph.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OT/glyf/Glyph.hh b/src/OT/glyf/Glyph.hh index aa2a41c7a..2bd5fe820 100644 --- a/src/OT/glyf/Glyph.hh +++ b/src/OT/glyf/Glyph.hh @@ -555,10 +555,11 @@ struct Glyph int num_contours = header->numberOfContours; if (unlikely (num_contours == 0)) type = EMPTY; else if (num_contours > 0) type = SIMPLE; + else if (num_contours == -1) type = COMPOSITE; #ifndef HB_NO_VAR_COMPOSITES else if (num_contours == -2) type = VAR_COMPOSITE; #endif - else type = COMPOSITE; /* negative numbers */ + else type = EMPTY; // Spec deviation; Spec says COMPOSITE, but not seen in the wild. } protected: