diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index a1f65eb01..4a48a7cc3 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -207,13 +207,13 @@ struct COLR + hb_range (c->plan->num_output_glyphs ()) | hb_map_retains_sorting ([&](hb_codepoint_t new_gid) { - hb_codepoint_t old_gid = reverse_glyph_map.get(new_gid); + hb_codepoint_t old_gid = reverse_glyph_map.get (new_gid); + const BaseGlyphRecord* old_record = get_base_glyph_record (old_gid); + if (unlikely (!old_record)) + return hb_pair_t (false, Null (BaseGlyphRecord)); BaseGlyphRecord new_record; - if (unlikely (!old_record)) - return hb_pair_t (false, new_record); - new_record.glyphId = new_gid; new_record.numLayers = old_record->numLayers; return hb_pair_t (true, new_record);