From f10ddb8dd870fd691c8876c1c7151e607aab0625 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 5 May 2022 11:21:24 -0600 Subject: [PATCH] [cmap] Use -1 as Unicode sentinel, not U+FFFF in Format12 serialize --- src/hb-ot-cmap-table.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 5ea6677fe..d050b2ff7 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -798,12 +798,12 @@ struct CmapSubtableFormat12 : CmapSubtableLongSegmented unsigned table_initpos = c->length (); if (unlikely (!c->extend_min (this))) return; - hb_codepoint_t startCharCode = 0xFFFF, endCharCode = 0xFFFF; + hb_codepoint_t startCharCode = (hb_codepoint_t) -1, endCharCode = (hb_codepoint_t) -1; hb_codepoint_t glyphID = 0; for (const auto& _ : +it) { - if (startCharCode == 0xFFFF) + if (startCharCode == (hb_codepoint_t) -1) { startCharCode = _.first; endCharCode = _.first;