1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 01:28:06 +02:00

Merge pull request #14823 from Snuffleupagus/issue-14821

Ignore invalid /Encoding-entries when parsing fonts (issue 14821)
This commit is contained in:
Tim van der Meij 2022-04-23 13:19:26 +02:00 committed by GitHub
commit f9e54d9226
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 1 deletions

View file

@ -3405,7 +3405,12 @@ class PartialEvaluator {
} else if (encoding instanceof Name) {
baseEncodingName = encoding.name;
} else {
throw new FormatError("Encoding is not a Name nor a Dict");
const msg = "Encoding is not a Name nor a Dict";
if (!this.options.ignoreErrors) {
throw new FormatError(msg);
}
warn(msg);
}
// According to table 114 if the encoding is a named encoding it must be
// one of these predefined encodings.