diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index fe722a44552..e4f705fb284 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -281,9 +281,8 @@ struct glyf { static const GlyphHeader &from_bytes (hb_bytes_t glyph_bytes) { - return glyph_bytes.length < GlyphHeader::static_size - ? Null (GlyphHeader) - : StructAtOffset (&glyph_bytes, 0); + return likely (glyph_bytes.length >= static_size) + ? StructAtOffset (&glyph_bytes, 0) : Null (GlyphHeader); } unsigned int simple_instruction_len_offset () const