mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 10:15:37 +02:00
Merge pull request #14823 from Snuffleupagus/issue-14821
Ignore invalid /Encoding-entries when parsing fonts (issue 14821)
This commit is contained in:
commit
f9e54d9226
4 changed files with 13 additions and 1 deletions
|
@ -3405,7 +3405,12 @@ class PartialEvaluator {
|
||||||
} else if (encoding instanceof Name) {
|
} else if (encoding instanceof Name) {
|
||||||
baseEncodingName = encoding.name;
|
baseEncodingName = encoding.name;
|
||||||
} else {
|
} 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
|
// According to table 114 if the encoding is a named encoding it must be
|
||||||
// one of these predefined encodings.
|
// one of these predefined encodings.
|
||||||
|
|
1
test/pdfs/.gitignore
vendored
1
test/pdfs/.gitignore
vendored
|
@ -129,6 +129,7 @@
|
||||||
!asciihexdecode.pdf
|
!asciihexdecode.pdf
|
||||||
!bug766086.pdf
|
!bug766086.pdf
|
||||||
!bug793632.pdf
|
!bug793632.pdf
|
||||||
|
!issue14821.pdf
|
||||||
!bug1020858.pdf
|
!bug1020858.pdf
|
||||||
!prefilled_f1040.pdf
|
!prefilled_f1040.pdf
|
||||||
!bug1050040.pdf
|
!bug1050040.pdf
|
||||||
|
|
BIN
test/pdfs/issue14821.pdf
Normal file
BIN
test/pdfs/issue14821.pdf
Normal file
Binary file not shown.
|
@ -3619,6 +3619,12 @@
|
||||||
"rounds": 1,
|
"rounds": 1,
|
||||||
"type": "eq"
|
"type": "eq"
|
||||||
},
|
},
|
||||||
|
{ "id": "issue14821",
|
||||||
|
"file": "pdfs/issue14821.pdf",
|
||||||
|
"md5": "ae77afb0f98c62e6b7fe7f912c84a75c",
|
||||||
|
"rounds": 1,
|
||||||
|
"type": "eq"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "issue6165",
|
"id": "issue6165",
|
||||||
"file": "pdfs/issue6165.pdf",
|
"file": "pdfs/issue6165.pdf",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue