Skip to content

Commit

Permalink
Merge pull request #3265 from yurydelendik/issue-3263
Browse files Browse the repository at this point in the history
Ensure we don't modify the original PDF data when sanitizing TrueType
  • Loading branch information
brendandahl committed May 17, 2013
2 parents e3f69f9 + b0ea064 commit 59d0ccf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3870,6 +3870,9 @@ var Font = (function FontClosure() {
}
}

// The following steps modify the original font data, making copy
font = new Stream(new Uint8Array(font.getBytes()));

// Check that required tables are present
var requiredTables = ['OS/2', 'cmap', 'head', 'hhea',
'hmtx', 'maxp', 'name', 'post'];
Expand Down
1 change: 1 addition & 0 deletions test/pdfs/issue3263.pdf.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://visionmedia.dev.cervantesvirtual.com/web/220816.pdf
9 changes: 9 additions & 0 deletions test/test_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,15 @@
"rounds": 1,
"type": "eq"
},
{ "id": "issue3263",
"file": "pdfs/issue3263.pdf",
"md5": "cee1cf0bd7ce6681cdb97c8e42697d81",
"rounds": 1,
"link": true,
"firstPage": 18,
"lastPage": 19,
"type": "eq"
},
{ "id": "issue2761",
"file": "pdfs/issue2761.pdf",
"md5": "35df0b8cff4afec0c08f08c6a5bc9857",
Expand Down

0 comments on commit 59d0ccf

Please sign in to comment.