Fix for erroneous encoded ccitt lines

The ccitt tiff is missing a terminating huffman code on a line end. The following EOL is misinterpreted and the codestream read till an ArrayIndexOutOfBoundsException occurs.
Now reading the line is aborted as soon as an EOL is found.
This commit is contained in:
Oliver Schmidtmer
2017-06-07 13:44:49 +02:00
parent 86fa76c17d
commit 4e640dda51
3 changed files with 25 additions and 2 deletions
@@ -355,11 +355,14 @@ final class CCITTFaxDecoderStream extends FilterInputStream {
if (n.isLeaf) {
total += n.value;
if (n.value < 64) {
if (n.value >= 64) {
n = tree.root;
}
else if (n.value >= 0) {
return total;
}
else {
n = tree.root;
return columns;
}
}
}