diff --git a/src/core/fonts.js b/src/core/fonts.js index 0c511f8aa..5017d1b93 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -1832,6 +1832,9 @@ var Font = (function FontClosure() { } for (i = 0, ii = records.length; i < ii; i++) { var record = records[i]; + if (record.length <= 0) { + continue; // Nothing to process, ignoring. + } var pos = start + stringsStart + record.offset; if (pos + record.length > end) { continue; // outside of name table, ignoring diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index a771174a0..106de2ce3 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -19,6 +19,7 @@ !issue5874.pdf !issue6782.pdf !issue6961.pdf +!issue7020.pdf !filled-background.pdf !ArabicCIDTrueType.pdf !ThuluthFeatures.pdf diff --git a/test/pdfs/issue7020.pdf b/test/pdfs/issue7020.pdf new file mode 100644 index 000000000..e9ee3bc10 Binary files /dev/null and b/test/pdfs/issue7020.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index edb7abf20..c8095cb4a 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -1217,6 +1217,13 @@ "lastPage": 1, "type": "load" }, + { "id": "issue7020", + "file": "pdfs/issue7020.pdf", + "md5": "93b464e21c649e64ae92eeafe99fc31b", + "link": false, + "rounds": 1, + "type": "eq" + }, { "id": "pr4606", "file": "pdfs/pr4606.pdf", "md5": "6574fde2314648600056bd0e229df98c",