[glyf] minor

This commit is contained in:
Ebrahim Byagowi 2019-08-25 12:37:40 +04:30 committed by GitHub
parent 07e467a30e
commit 2f8e823331
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -281,9 +281,8 @@ struct glyf
{ {
static const GlyphHeader &from_bytes (hb_bytes_t glyph_bytes) static const GlyphHeader &from_bytes (hb_bytes_t glyph_bytes)
{ {
return glyph_bytes.length < GlyphHeader::static_size return likely (glyph_bytes.length >= static_size)
? Null (GlyphHeader) ? StructAtOffset<GlyphHeader> (&glyph_bytes, 0) : Null (GlyphHeader);
: StructAtOffset<GlyphHeader> (&glyph_bytes, 0);
} }
unsigned int simple_instruction_len_offset () const unsigned int simple_instruction_len_offset () const