Merge pull request #7302 from Snuffleupagus/Parser_getObj-skip-over-endobj

Ignore 'endobj' commands inside of `ObjStm` streams (issue 5241, bug 898610, bug 1037816)
This commit is contained in:
Yury Delendik 2016-05-09 11:03:14 -05:00
commit dd828ea6f1
3 changed files with 15 additions and 0 deletions

View File

@ -1175,6 +1175,11 @@ var XRef = (function XRefClosure() {
// read stream objects for cache
for (i = 0; i < n; ++i) {
entries.push(parser.getObj());
// The ObjStm should not contain 'endobj'. If it's present, skip over it
// to support corrupt PDFs (fixes issue 5241, bug 898610, bug 1037816).
if (isCmd(parser.buf1, 'endobj')) {
parser.shift();
}
num = nums[i];
var entry = this.entries[num];
if (entry && entry.offset === tableOffset && entry.gen === i) {

View File

@ -0,0 +1 @@
http://web.archive.org/web/20160509072707/http://www.oranjewoudnv.nl/sites/default/files/Oranjewoud%20NV%20-%20%20besluiten%20aandeelhoudersvergadering%2011%20juni%202014.pdf

View File

@ -1128,6 +1128,15 @@
"type": "eq",
"about": "Font with an empty font file."
},
{ "id": "bug1037816",
"file": "pdfs/bug1037816.pdf",
"md5": "8a45299d7b102a9c1cadb8883b8debc9",
"rounds": 1,
"link": true,
"lastPage": 1,
"type": "load",
"about": "ObjStm stream containing 'endobj' commands."
},
{ "id": "ocs",
"file": "pdfs/ocs.pdf",
"md5": "2ade57e954ae7632749cf328daeaa7a8",