Enable loading of PDFs with undefined or missing stream lengths
This commit is contained in:
parent
abe00cbc76
commit
628f4aaf81
@ -208,8 +208,10 @@ var Parser = (function ParserClosure() {
|
||||
|
||||
// get length
|
||||
var length = this.fetchIfRef(dict.get('Length'));
|
||||
if (!isInt(length))
|
||||
error('Bad ' + length + ' attribute in stream');
|
||||
if (!isInt(length)) {
|
||||
info('Bad ' + length + ' attribute in stream');
|
||||
length = 0;
|
||||
}
|
||||
|
||||
// skip over the stream data
|
||||
stream.pos = pos + length;
|
||||
|
1
test/pdfs/issue1293.pdf.link
Normal file
1
test/pdfs/issue1293.pdf.link
Normal file
@ -0,0 +1 @@
|
||||
http://dl.dropbox.com/u/22242495/pdfjs/pdfkit_uncompressed.pdf
|
@ -23,6 +23,16 @@
|
||||
"rounds": 1,
|
||||
"type": "text"
|
||||
},
|
||||
{ "id": "issue1293",
|
||||
"file": "pdfs/issue1293.pdf",
|
||||
"md5": "0a744b3bbf2fd8da0131fd3c01dd1e30",
|
||||
"rounds": 1,
|
||||
"link": true,
|
||||
"firstPage": 1,
|
||||
"lastPage": 1,
|
||||
"type": "load",
|
||||
"about": "PDF with undefined stream length."
|
||||
},
|
||||
{ "id": "issue2881",
|
||||
"file": "pdfs/issue2881.pdf",
|
||||
"md5": "ea6ade27d2cb146676d23dcd6605d5ee",
|
||||
|
Loading…
Reference in New Issue
Block a user