mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-04-30 00:00:01 -04:00
Fix getNextChangingElement
The Testimage is distored without this change. lastChangchingElement must be reduced by 2 as sometimes the nextChanchingElement is bevore the last chanching element. Reset the last bits does not work if the number is higher.
This commit is contained in:
+5
-1
@@ -221,7 +221,11 @@ final class CCITTFaxDecoderStream extends FilterInputStream {
|
||||
}
|
||||
|
||||
private int getNextChangingElement(final int a0, final boolean white) throws IOException {
|
||||
int start = (lastChangingElement & 0xFFFF_FFFC) + (white ? 0 : 1);
|
||||
int start = (lastChangingElement & 0xFFFF_FFFE) + (white ? 0 : 1);
|
||||
if (start > 2) {
|
||||
start -= 2;
|
||||
}
|
||||
|
||||
if (a0 == 0) {
|
||||
return start;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user