Răsfoiți Sursa

PDF.js version 1.1.286

Pdf Bot 10 ani în urmă
părinte
comite
d6622c9612
5 a modificat fișierele cu 36 adăugiri și 14 ștergeri
  1. 1 1
      bower.json
  2. 16 5
      build/pdf.combined.js
  3. 2 2
      build/pdf.js
  4. 16 5
      build/pdf.worker.js
  5. 1 1
      package.json

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.1.284",
+  "version": "1.1.286",
   "main": [
     "build/pdf.js",
     "build/pdf.worker.js"

+ 16 - 5
build/pdf.combined.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.1.284';
-PDFJS.build = '535b7c2';
+PDFJS.version = '1.1.286';
+PDFJS.build = 'dde3e4a';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -36870,6 +36870,16 @@ var Parser = (function ParserClosure() {
         this.buf2 = this.lexer.getObj();
       }
     },
+    tryShift: function Parser_tryShift() {
+      try {
+        this.shift();
+        return true;
+      } catch (e) {
+        // Upon failure, the caller should reset this.lexer.pos to a known good
+        // state and call this.shift() twice to reset the buffers.
+        return false;
+      }
+    },
     getObj: function Parser_getObj(cipherTransform) {
       var buf1 = this.buf1;
       this.shift();
@@ -37243,9 +37253,10 @@ var Parser = (function ParserClosure() {
       stream.pos = pos + length;
       lexer.nextChar();
 
-      this.shift(); // '>>'
-      this.shift(); // 'stream'
-      if (!isCmd(this.buf1, 'endstream')) {
+      // Shift '>>' and check whether the new object marks the end of the stream
+      if (this.tryShift() && isCmd(this.buf2, 'endstream')) {
+        this.shift(); // 'stream'
+      } else {
         // bad stream length, scanning for endstream
         stream.pos = pos;
         var SCAN_BLOCK_SIZE = 2048;

+ 2 - 2
build/pdf.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.1.284';
-PDFJS.build = '535b7c2';
+PDFJS.version = '1.1.286';
+PDFJS.build = 'dde3e4a';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it

+ 16 - 5
build/pdf.worker.js

@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.1.284';
-PDFJS.build = '535b7c2';
+PDFJS.version = '1.1.286';
+PDFJS.build = 'dde3e4a';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -30464,6 +30464,16 @@ var Parser = (function ParserClosure() {
         this.buf2 = this.lexer.getObj();
       }
     },
+    tryShift: function Parser_tryShift() {
+      try {
+        this.shift();
+        return true;
+      } catch (e) {
+        // Upon failure, the caller should reset this.lexer.pos to a known good
+        // state and call this.shift() twice to reset the buffers.
+        return false;
+      }
+    },
     getObj: function Parser_getObj(cipherTransform) {
       var buf1 = this.buf1;
       this.shift();
@@ -30837,9 +30847,10 @@ var Parser = (function ParserClosure() {
       stream.pos = pos + length;
       lexer.nextChar();
 
-      this.shift(); // '>>'
-      this.shift(); // 'stream'
-      if (!isCmd(this.buf1, 'endstream')) {
+      // Shift '>>' and check whether the new object marks the end of the stream
+      if (this.tryShift() && isCmd(this.buf2, 'endstream')) {
+        this.shift(); // 'stream'
+      } else {
         // bad stream length, scanning for endstream
         stream.pos = pos;
         var SCAN_BLOCK_SIZE = 2048;

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.1.284",
+  "version": "1.1.286",
   "description": "Generic build of Mozilla's PDF.js library.",
   "keywords": [
     "Mozilla",