Browse Source

Merge pull request #7049 from Snuffleupagus/issue-7020

Avoid accidentally getting the entire font file in `readNameTable` (issue 7020)
Brendan Dahl 9 years ago
parent
commit
6b1de4aa38
  1. 3
      src/core/fonts.js
  2. 1
      test/pdfs/.gitignore
  3. BIN
      test/pdfs/issue7020.pdf
  4. 7
      test/test_manifest.json

3
src/core/fonts.js

@ -1832,6 +1832,9 @@ var Font = (function FontClosure() { @@ -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

1
test/pdfs/.gitignore vendored

@ -19,6 +19,7 @@ @@ -19,6 +19,7 @@
!issue5874.pdf
!issue6782.pdf
!issue6961.pdf
!issue7020.pdf
!filled-background.pdf
!ArabicCIDTrueType.pdf
!ThuluthFeatures.pdf

BIN
test/pdfs/issue7020.pdf

Binary file not shown.

7
test/test_manifest.json

@ -1217,6 +1217,13 @@ @@ -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",

Loading…
Cancel
Save