Fix hb_ot_color_has_paint

We must no access v1 data without checking that
version is 1. A bit of a trap.
This commit is contained in:
Matthias Clasen 2022-12-26 08:23:55 -05:00 committed by Behdad Esfahbod
parent b8f2281c6c
commit 5dd69d81b0
1 changed files with 7 additions and 1 deletions

View File

@ -1701,7 +1701,13 @@ struct COLR
static constexpr hb_tag_t tableTag = HB_OT_TAG_COLR;
bool has_v0_data () const { return numBaseGlyphs; }
bool has_v1_data () const { return (this+baseGlyphList).len; }
bool has_v1_data () const
{
if (version == 1)
return (this+baseGlyphList).len > 0;
return false;
}
unsigned int get_glyph_layers (hb_codepoint_t glyph,
unsigned int start_offset,