Replace terminal null char by a endchar command in CFF charstrings to make OTS happy

This commit is contained in:
Calixte Denizet 2021-05-14 18:34:51 +02:00
parent e394da5861
commit f92e1fa160

View File

@ -599,6 +599,12 @@ const CFFParser = (function CFFParserClosure() {
} else if (value === 11) {
state.stackSize = stackSize;
return true;
} else if (value === 0 && j === data.length) {
// Operator 0 is not used according to the current spec and
// it's the last char and consequently it's likely a terminator.
// So just replace it by endchar command to make OTS happy.
data[j - 1] = 14;
validationCommand = CharstringValidationData[14];
} else {
validationCommand = CharstringValidationData[value];
}