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:
commit
dd828ea6f1
@ -1175,6 +1175,11 @@ var XRef = (function XRefClosure() {
|
|||||||
// read stream objects for cache
|
// read stream objects for cache
|
||||||
for (i = 0; i < n; ++i) {
|
for (i = 0; i < n; ++i) {
|
||||||
entries.push(parser.getObj());
|
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];
|
num = nums[i];
|
||||||
var entry = this.entries[num];
|
var entry = this.entries[num];
|
||||||
if (entry && entry.offset === tableOffset && entry.gen === i) {
|
if (entry && entry.offset === tableOffset && entry.gen === i) {
|
||||||
|
1
test/pdfs/bug1037816.pdf.link
Normal file
1
test/pdfs/bug1037816.pdf.link
Normal 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
|
@ -1128,6 +1128,15 @@
|
|||||||
"type": "eq",
|
"type": "eq",
|
||||||
"about": "Font with an empty font file."
|
"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",
|
{ "id": "ocs",
|
||||||
"file": "pdfs/ocs.pdf",
|
"file": "pdfs/ocs.pdf",
|
||||||
"md5": "2ade57e954ae7632749cf328daeaa7a8",
|
"md5": "2ade57e954ae7632749cf328daeaa7a8",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user