Skip to content

Commit

Permalink
[glyf] minor
Browse files Browse the repository at this point in the history
  • Loading branch information
ebraminio committed Aug 25, 2019
1 parent 07e467a commit 2f8e823
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/hb-ot-glyf-table.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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<GlyphHeader> (&glyph_bytes, 0);
return likely (glyph_bytes.length >= static_size)
? StructAtOffset<GlyphHeader> (&glyph_bytes, 0) : Null (GlyphHeader);
}

unsigned int simple_instruction_len_offset () const
Expand Down

0 comments on commit 2f8e823

Please sign in to comment.