TMI-101, 102 & 103: Now better handles broken data (throws IIOException) and better detects bogus Adobe markers.

This commit is contained in:
Harald Kuhr 2015-03-02 10:29:19 +01:00
parent 1f99040927
commit 5b95f57066

View File

@ -559,13 +559,11 @@ public class JPEGImageReader extends ImageReaderBase {
if (adobeDCT != null) {
switch (adobeDCT.getTransform()) {
case AdobeDCTSegment.YCC:
// TODO: Verify that startOfFrame has 3 components, otherwise issue warning and ignore adobeDCT
if (startOfFrame.components.length != 3) {
break;
}
return JPEGColorSpace.YCbCr;
case AdobeDCTSegment.YCCK:
// TODO: Verify that startOfFrame has 4 components, otherwise issue warning and ignore adobeDCT
if (startOfFrame.components.length != 4) {
break;
}