[subset] Don't assume the last segment in cmap 4 can be skipped, actually check it.

This commit is contained in:
Garret Rieger 2018-04-16 15:09:27 -07:00
parent 21a181af2b
commit 39754fb659
1 changed files with 6 additions and 2 deletions

View File

@ -130,9 +130,13 @@ struct CmapSubtableFormat4
static inline void get_all_codepoints_func (const void *obj, hb_set_t *out) static inline void get_all_codepoints_func (const void *obj, hb_set_t *out)
{ {
const accelerator_t *thiz = (const accelerator_t *) obj; const accelerator_t *thiz = (const accelerator_t *) obj;
for (unsigned int i = 0; i < thiz->segCount - 1; i++) // Skip the last segment (0xFFFF) for (unsigned int i = 0; i < thiz->segCount; i++)
{
if (thiz->startCount[i] != 0xFFFFu
|| thiz->endCount[i] != 0xFFFFu) // Skip the last segment (0xFFFF)
hb_set_add_range (out, thiz->startCount[i], thiz->endCount[i]); hb_set_add_range (out, thiz->startCount[i], thiz->endCount[i]);
} }
}
const HBUINT16 *endCount; const HBUINT16 *endCount;
const HBUINT16 *startCount; const HBUINT16 *startCount;