mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-05-28 00:00:03 -04:00
#645 AAIOBE in CCITTFaxDecoderStream now wrapped in IOException
This commit is contained in:
+6
-2
@@ -30,14 +30,14 @@
|
||||
|
||||
package com.twelvemonkeys.imageio.plugins.tiff;
|
||||
|
||||
import com.twelvemonkeys.lang.Validate;
|
||||
|
||||
import java.io.EOFException;
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.twelvemonkeys.lang.Validate;
|
||||
|
||||
/**
|
||||
* CCITT Modified Huffman RLE, Group 3 (T4) and Group 4 (T6) fax compression.
|
||||
*
|
||||
@@ -198,6 +198,10 @@ final class CCITTFaxDecoderStream extends FilterInputStream {
|
||||
try {
|
||||
decodeRow();
|
||||
}
|
||||
catch (ArrayIndexOutOfBoundsException e) {
|
||||
// Mask the AIOOBE as an IOException
|
||||
throw new IOException("Malformed CCITT stream", e);
|
||||
}
|
||||
catch (EOFException e) {
|
||||
// TODO: Rewrite to avoid throw/catch for normal flow...
|
||||
if (decodedLength != 0) {
|
||||
|
||||
Reference in New Issue
Block a user