1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Make XRef_indexObjects even more robust against bad PDF files, by checking for the existence of 'trailer' if 'xref' is not found

Fixes http://www.cyjack.com/cognition/Terence%20McKenna%20-%20Lectures%20on%20Alchemy.pdf.
This commit is contained in:
Jonas Jenwald 2015-10-01 14:46:03 +02:00
parent 1bdfc47de8
commit 192907e0d2
4 changed files with 78 additions and 0 deletions

View file

@ -1118,6 +1118,10 @@ var XRef = (function XRefClosure() {
}
position += contentLength;
} else if (token.indexOf('trailer') === 0 &&
(token.length === 7 || /\s/.test(token[7]))) {
trailers.push(position);
position += skipUntil(buffer, position, startxrefBytes);
} else {
position += token.length + 1;
}