From cbb45c3ee7be42091a04fc1edfd98a07cfcd864c Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Tue, 11 Feb 2020 16:46:14 +0330 Subject: [PATCH] [subset/colr] minor improve to resolve msvc complain MSVC says, hb-ot-color-colr-table.hh(215): warning C4700: uninitialized local variable 'new_record' used [build\harfbuzz-subset.vcxproj] harfbuzz-subset.vcxproj -> build\Debug\harfbuzz-subset.lib --- src/hb-ot-color-colr-table.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);