[subset] inputSequence could be empty, change the sanity check

This commit is contained in:
Qunxin Liu 2021-11-18 16:53:36 -08:00 committed by Behdad Esfahbod
parent a75b96f7e5
commit e88fc41ef3
8 changed files with 14 additions and 3 deletions

View File

@ -1642,9 +1642,8 @@ struct Rule
const hb_map_t *klass_map = nullptr) const
{
TRACE_SUBSET (this);
const hb_array_t<const HBUINT16> input = inputZ.as_array ((inputCount ? inputCount - 1 : 0));
if (!input.length) return_trace (false);
if (unlikely (!inputCount)) return_trace (false);
const hb_array_t<const HBUINT16> input = inputZ.as_array (inputCount - 1);
const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map;
if (!hb_all (input, mapping)) return_trace (false);

View File

@ -33,6 +33,7 @@ EXTRA_DIST += \
expected/layout.gdef \
expected/layout.gdef.glyphset \
expected/layout.context \
expected/layout.context_format2 \
expected/layout.gdef-varstore \
expected/layout.gdef-attachlist \
expected/layout.notonastaliqurdu \

View File

@ -13,6 +13,7 @@ TESTS = \
tests/glyf_bug_3131.tests \
tests/japanese.tests \
tests/layout.context.tests \
tests/layout.context_format2.tests \
tests/layout.gdef-attachlist.tests \
tests/layout.gdef-varstore.tests \
tests/layout.gdef.tests \

Binary file not shown.

View File

@ -0,0 +1,9 @@
FONTS:
NotoSansNewa-Regular.ttf
PROFILES:
layout-test.txt
layout-test-retain-gids.txt
SUBSETS:
*

View File

@ -25,6 +25,7 @@ tests = [
'layout.gdef.glyphset',
'layout.khmer',
'layout.context',
'layout.context_format2',
'layout.gdef-varstore',
'layout.gdef-attachlist',
'layout.notonastaliqurdu',