Merge pull request #15192 from Snuffleupagus/issue-15139

Ignore invalid /CIDToGIDMap-entries when parsing fonts (issue 15139)
This commit is contained in:
Jonas Jenwald 2022-07-20 12:45:04 +02:00 committed by GitHub
commit a9fc8792c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View File

@ -3373,9 +3373,16 @@ class PartialEvaluator {
}; };
} }
const cidToGidMap = dict.get("CIDToGIDMap"); try {
if (cidToGidMap instanceof BaseStream) { const cidToGidMap = dict.get("CIDToGIDMap");
cidToGidBytes = cidToGidMap.getBytes(); if (cidToGidMap instanceof BaseStream) {
cidToGidBytes = cidToGidMap.getBytes();
}
} catch (ex) {
if (!this.options.ignoreErrors) {
throw ex;
}
warn(`extractDataStructures - ignoring CIDToGIDMap data: "${ex}".`);
} }
} }

View File

@ -0,0 +1 @@
https://github.com/mozilla/pdf.js/files/9137443/sample4a.pdf

View File

@ -4980,6 +4980,14 @@
"lastPage": 1, "lastPage": 1,
"type": "eq" "type": "eq"
}, },
{ "id": "issue15139",
"file": "pdfs/issue15139.pdf",
"md5": "0f2beb6a788d1e47bb9af737f6670493",
"rounds": 1,
"link": true,
"lastPage": 1,
"type": "eq"
},
{ "id": "gesamt", { "id": "gesamt",
"file": "pdfs/gesamt.pdf", "file": "pdfs/gesamt.pdf",
"md5": "743aaa6f46ed0a42864f079d632d942e", "md5": "743aaa6f46ed0a42864f079d632d942e",