From 7b77cd198c0352b6ed2a0adbee68bb3e246b9658 Mon Sep 17 00:00:00 2001 From: Qunxin Liu Date: Mon, 13 Mar 2023 12:45:43 -0700 Subject: [PATCH] [subset] fix bug in CPAL V1tail serialization We should serialize nameIDs rather than retained color index --- src/OT/Color/CPAL/CPAL.hh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/OT/Color/CPAL/CPAL.hh b/src/OT/Color/CPAL/CPAL.hh index 4914a0ed5..6646b083e 100644 --- a/src/OT/Color/CPAL/CPAL.hh +++ b/src/OT/Color/CPAL/CPAL.hh @@ -95,13 +95,10 @@ struct CPALV1Tail if (colorLabelsZ) { c->push (); - for (const auto _ : colorLabels) + for (unsigned i = 0; i < color_count; i++) { - const hb_codepoint_t *v; - if (!color_index_map->has (_, &v)) continue; - NameID new_color_idx; - new_color_idx = *v; - if (!c->copy (new_color_idx)) + if (!color_index_map->has (i)) continue; + if (!c->copy (colorLabels[i])) { c->pop_discard (); return_trace (false);