[Pkg-javascript-commits] [pdf.js] 116/246: Properly set this.eof in CCITTFaxStream

David Prévot taffit at moszumanska.debian.org
Sun Sep 7 15:36:31 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 5cc7d23066de073581659ad823c4c255ef237dce
Author: Tim van der Meij <timvandermeij at gmail.com>
Date:   Tue Aug 5 17:26:17 2014 +0200

    Properly set this.eof in CCITTFaxStream
---
 src/core/stream.js | 27 ++++++++++++++++-----------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/src/core/stream.js b/src/core/stream.js
index 3041591..4e9921d 100644
--- a/src/core/stream.js
+++ b/src/core/stream.js
@@ -2018,34 +2018,39 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
         }
       }
 
-      if (this.byteAlign) {
-        this.inputBits &= ~7;
-      }
-
       var gotEOL = false;
 
       if (!this.eoblock && this.row === this.rows - 1) {
         this.eof = true;
-      } else {
+      } else if (this.eoline || !this.byteAlign) {
         code1 = this.lookBits(12);
-        while (code1 === 0) {
-          this.eatBits(1);
-          code1 = this.lookBits(12);
+        if (this.eoline) {
+          while (code1 !== EOF && code1 !== 1) {
+            this.eatBits(1);
+            code1 = this.lookBits(12);
+          }
+        } else {
+          while (code1 === 0) {
+            this.eatBits(1);
+            code1 = this.lookBits(12);
+          }
         }
         if (code1 === 1) {
           this.eatBits(12);
           gotEOL = true;
-        } else if (code1 === EOF) {
-          this.eof = true;
         }
       }
 
+      if (this.byteAlign && !gotEOL) {
+        this.inputBits &= ~7;
+      }
+
       if (!this.eof && this.encoding > 0) {
         this.nextLine2D = !this.lookBits(1);
         this.eatBits(1);
       }
 
-      if (this.eoblock && gotEOL) {
+      if (this.eoblock && !this.eoline && this.byteAlign) {
         code1 = this.lookBits(12);
         if (code1 === 1) {
           this.eatBits(12);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list