Merge pull request #13378 from calixteman/10544

Replace terminal null char by a endchar command in CFF charstrings to make OTS happy
This commit is contained in:
Jonas Jenwald 2021-06-01 16:04:09 +02:00 committed by GitHub
commit 3456ed271b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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];
}