Merge pull request #5136 from timvandermeij/ccitt-lines
Properly set this.eof in CCITTFaxStream
This commit is contained in:
commit
12b50486de
@ -2018,34 +2018,39 @@ var CCITTFaxStream = (function CCITTFaxStreamClosure() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.byteAlign) {
|
|
||||||
this.inputBits &= ~7;
|
|
||||||
}
|
|
||||||
|
|
||||||
var gotEOL = false;
|
var gotEOL = false;
|
||||||
|
|
||||||
if (!this.eoblock && this.row === this.rows - 1) {
|
if (!this.eoblock && this.row === this.rows - 1) {
|
||||||
this.eof = true;
|
this.eof = true;
|
||||||
} else {
|
} else if (this.eoline || !this.byteAlign) {
|
||||||
code1 = this.lookBits(12);
|
code1 = this.lookBits(12);
|
||||||
while (code1 === 0) {
|
if (this.eoline) {
|
||||||
this.eatBits(1);
|
while (code1 !== EOF && code1 !== 1) {
|
||||||
code1 = this.lookBits(12);
|
this.eatBits(1);
|
||||||
|
code1 = this.lookBits(12);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
while (code1 === 0) {
|
||||||
|
this.eatBits(1);
|
||||||
|
code1 = this.lookBits(12);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (code1 === 1) {
|
if (code1 === 1) {
|
||||||
this.eatBits(12);
|
this.eatBits(12);
|
||||||
gotEOL = true;
|
gotEOL = true;
|
||||||
} else if (code1 === EOF) {
|
|
||||||
this.eof = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.byteAlign && !gotEOL) {
|
||||||
|
this.inputBits &= ~7;
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.eof && this.encoding > 0) {
|
if (!this.eof && this.encoding > 0) {
|
||||||
this.nextLine2D = !this.lookBits(1);
|
this.nextLine2D = !this.lookBits(1);
|
||||||
this.eatBits(1);
|
this.eatBits(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.eoblock && gotEOL) {
|
if (this.eoblock && !this.eoline && this.byteAlign) {
|
||||||
code1 = this.lookBits(12);
|
code1 = this.lookBits(12);
|
||||||
if (code1 === 1) {
|
if (code1 === 1) {
|
||||||
this.eatBits(12);
|
this.eatBits(12);
|
||||||
|
Loading…
Reference in New Issue
Block a user