From 3ebf4960386273c46c85d4bab7cc0992e0e225a8 Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Wed, 17 Aug 2016 12:49:25 +0100 Subject: [PATCH] PDF.js version 1.5.378 - See mozilla/pdf.js@084fc517fea2e9d59b9afb1decc87a65efd6e07d --- bower.json | 2 +- build/pdf.combined.js | 23 ++++++++++++++++------- build/pdf.js | 4 ++-- build/pdf.worker.js | 23 ++++++++++++++++------- package.json | 2 +- 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/bower.json b/bower.json index d6239b27d..a1f51c22a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.376", + "version": "1.5.378", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 0b9e334e3..8d6f85000 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.376'; -var pdfjsBuild = '9408996'; +var pdfjsVersion = '1.5.378'; +var pdfjsBuild = '084fc51'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -28459,10 +28459,11 @@ function isEOF(v) { var MAX_LENGTH_TO_CACHE = 1000; var Parser = (function ParserClosure() { - function Parser(lexer, allowStreams, xref) { + function Parser(lexer, allowStreams, xref, recoveryMode) { this.lexer = lexer; this.allowStreams = allowStreams; this.xref = xref; + this.recoveryMode = recoveryMode || false; this.imageCache = Object.create(null); this.refill(); } @@ -28508,7 +28509,10 @@ var Parser = (function ParserClosure() { array.push(this.getObj(cipherTransform)); } if (isEOF(this.buf1)) { - error('End of file inside array'); + if (!this.recoveryMode) { + error('End of file inside array'); + } + return array; } this.shift(); return array; @@ -28529,7 +28533,10 @@ var Parser = (function ParserClosure() { dict.set(key, this.getObj(cipherTransform)); } if (isEOF(this.buf1)) { - error('End of file inside dictionary'); + if (!this.recoveryMode) { + error('End of file inside dictionary'); + } + return dict; } // Stream objects are not allowed inside content streams or @@ -43688,13 +43695,15 @@ var XRef = (function XRefClosure() { var dict; for (i = 0, ii = trailers.length; i < ii; ++i) { stream.pos = trailers[i]; - var parser = new Parser(new Lexer(stream), true, this); + var parser = new Parser(new Lexer(stream), /* allowStreams = */ true, + /* xref = */ this, /* recoveryMode = */ true); var obj = parser.getObj(); if (!isCmd(obj, 'trailer')) { continue; } // read the trailer dictionary - if (!isDict(dict = parser.getObj())) { + dict = parser.getObj(); + if (!isDict(dict)) { continue; } // taking the first one with 'ID' diff --git a/build/pdf.js b/build/pdf.js index 8a6249bf1..61d7ec127 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.376'; -var pdfjsBuild = '9408996'; +var pdfjsVersion = '1.5.378'; +var pdfjsBuild = '084fc51'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 2fcf5ac72..d7f408620 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.376'; -var pdfjsBuild = '9408996'; +var pdfjsVersion = '1.5.378'; +var pdfjsBuild = '084fc51'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -25028,10 +25028,11 @@ function isEOF(v) { var MAX_LENGTH_TO_CACHE = 1000; var Parser = (function ParserClosure() { - function Parser(lexer, allowStreams, xref) { + function Parser(lexer, allowStreams, xref, recoveryMode) { this.lexer = lexer; this.allowStreams = allowStreams; this.xref = xref; + this.recoveryMode = recoveryMode || false; this.imageCache = Object.create(null); this.refill(); } @@ -25077,7 +25078,10 @@ var Parser = (function ParserClosure() { array.push(this.getObj(cipherTransform)); } if (isEOF(this.buf1)) { - error('End of file inside array'); + if (!this.recoveryMode) { + error('End of file inside array'); + } + return array; } this.shift(); return array; @@ -25098,7 +25102,10 @@ var Parser = (function ParserClosure() { dict.set(key, this.getObj(cipherTransform)); } if (isEOF(this.buf1)) { - error('End of file inside dictionary'); + if (!this.recoveryMode) { + error('End of file inside dictionary'); + } + return dict; } // Stream objects are not allowed inside content streams or @@ -35339,13 +35346,15 @@ var XRef = (function XRefClosure() { var dict; for (i = 0, ii = trailers.length; i < ii; ++i) { stream.pos = trailers[i]; - var parser = new Parser(new Lexer(stream), true, this); + var parser = new Parser(new Lexer(stream), /* allowStreams = */ true, + /* xref = */ this, /* recoveryMode = */ true); var obj = parser.getObj(); if (!isCmd(obj, 'trailer')) { continue; } // read the trailer dictionary - if (!isDict(dict = parser.getObj())) { + dict = parser.getObj(); + if (!isDict(dict)) { continue; } // taking the first one with 'ID' diff --git a/package.json b/package.json index 6e36bd2f1..4537d7e1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.376", + "version": "1.5.378", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [