Special index entry 0xFFFF/0xFFFF not understood in `ft_var_load_delta_set_index_mapping`
In
ft_var_load_delta_set_index_mapping
entries in the DeltaSetIndexMap can assume the special 0xFFFF/0xFFFF form.
From the OT spec:
A complete delta-set index involves an outer-level index into the ItemVariationData subtable array, plus an inner-level index to a delta-set row within that subtable. A special meaning is assigned to a delta-set index 0xFFFF/0xFFFF (that is, outer-level and inner-level portions are both 0xFFFF): this is used to indicate that there is no variation data for a given item. Functionally, this would be equivalent to referencing delta-set data consisting of only deltas of 0 for all regions.
However, the code in ft_var_load_delta_set_index_mapping
has checks:
if ( outerIndex >= itemStore->dataCount )
and
if ( innerIndex >= itemStore->varData[outerIndex].itemCount )
which cause an InvalidTable
error to be thrown and returning from this function. I believe this is wrong and too strict.
I am not quite sure what the right fix should be. Setting entries in the allocated array to 0, or a sentinel value, or making a shorter array altogether? I would need to check more closely how these arrays are used.
This may affect tables that use DeltaSetIndexMap
, as listed here.
At the moment, this also blocks implementing variable COLRv1.