From 2f8e823331aca2c73b940f057f4b149a89af0502 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sun, 25 Aug 2019 12:37:40 +0430 Subject: [PATCH] [glyf] minor --- src/hb-ot-glyf-table.hh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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