Buggy code:
public class TIFFImageReader extends ImageReaderBase { static final boolean DEBUG = "true" . equalsIgnoreCase ( System . getProperty ( "com.twelvemonkeys.imageio.plugins.tiff.debug" ) ) ; private CompoundDirectory IFDs ; private Directory currentIFD ; TIFFImageReader ( final TIFFImageReaderSpi provider ) { } @ Override protected void resetMembers ( ) { } private void readMetadata ( ) throws IOException { } private void readIFD ( final int imageIndex ) throws IOException { } @ Override public int getNumImages ( final boolean allowSearch ) throws IOException { } private Number getValueAsNumberWithDefault ( final int tag , final String tagName , final Number defaultValue ) throws IIOException { } private long getValueAsLongWithDefault ( final int tag , final String tagName , final Long defaultValue ) throws IIOException { } private long getValueAsLongWithDefault ( final int tag , final Long defaultValue ) throws IIOException { } private int getValueAsIntWithDefault ( final int tag , final String tagName , final Integer defaultValue ) throws IIOException { } private int getValueAsIntWithDefault ( final int tag , Integer defaultValue ) throws IIOException { } private int getValueAsInt ( final int tag , String tagName ) throws IIOException { } @ Override public int getWidth ( int imageIndex ) throws IOException { } @ Override public int getHeight ( int imageIndex ) throws IOException { } @ Override public ImageTypeSpecifier getRawImageType ( int imageIndex ) throws IOException { } private int getDataType ( int sampleFormat , int bitsPerSample ) throws IIOException { } private IndexColorModel createIndexColorModel ( final int bitsPerSample , final int dataType , final int [ ] cmapShort ) { } private int getSampleFormat ( ) throws IIOException { } private int getBitsPerSample ( ) throws IIOException { } @ Override public Iterator < ImageTypeSpecifier > getImageTypes ( int imageIndex ) throws IOException { } @ Override public BufferedImage read ( int imageIndex , ImageReadParam param ) throws IOException { } private ImageReader createJPEGDelegate ( ) throws IIOException { } private static InputStream createJFIFStream ( WritableRaster raster , int stripTileWidth , int stripTileHeight , byte [ ] [ ] qTables , byte [ ] [ ] dcTables , byte [ ] [ ] acTables ) throws IOException { } private Raster clipRowToRect ( final Raster raster , final Rectangle rect , final int [ ] bands , final int xSub ) { } private WritableRaster clipToRect ( final WritableRaster raster , final Rectangle rect , final int [ ] bands ) { } private void readStripTileData ( final Raster tileRowRaster , final Rectangle srcRegion , final int xSub , final int ySub , final int numBands , final int interpretation , final WritableRaster raster , final int startCol , final int startRow , final int colsInTile , final int rowsInTile , final DataInput input ) throws IOException { } private void readFully ( final DataInput input , final float [ ] rowDataFloat ) throws IOException { } private void readFully ( final DataInput input , final int [ ] rowDataInt ) throws IOException { } private void readFully ( final DataInput input , final short [ ] rowDataShort ) throws IOException { } private void normalizeBlack ( int photometricInterpretation , short [ ] data ) { } private void normalizeBlack ( int photometricInterpretation , int [ ] data ) { } private void normalizeBlack ( int photometricInterpretation , byte [ ] data ) { } private InputStream createDecompressorStream ( final int compression , final int width , final int bands , final InputStream stream ) throws IOException { switch ( compression ) { case TIFFBaseline . COMPRESSION_NONE : return stream ; case TIFFBaseline . COMPRESSION_PACKBITS : return new com . twelvemonkeys . io . enc . DecoderStream ( stream , new PackBitsDecoder ( ) , 1024 ) ; case TIFFExtension . COMPRESSION_LZW : <START_BUG> return new com . twelvemonkeys . io . enc . DecoderStream ( stream , LZWDecoder . create ( LZWDecoder . isOldBitReversedStream ( stream ) ) , ( width * bands ) ) ; <END_BUG> case TIFFExtension . COMPRESSION_ZLIB : case TIFFExtension . COMPRESSION_DEFLATE : return new InflaterInputStream ( stream , new Inflater ( ) , 1024 ) ; case TIFFBaseline . COMPRESSION_CCITT_MODIFIED_HUFFMAN_RLE : return new CCITTFaxDecoderStream ( stream , width , compression , getValueAsIntWithDefault ( TAG_FILL_ORDER , 1 ) , 0L ) ; case TIFFExtension . COMPRESSION_CCITT_T4 : return new CCITTFaxDecoderStream ( stream , width , compression , getValueAsIntWithDefault ( TAG_FILL_ORDER , 1 ) , getValueAsLongWithDefault ( TAG_GROUP3OPTIONS , 0L ) ) ; case TIFFExtension . COMPRESSION_CCITT_T6 : return new CCITTFaxDecoderStream ( stream , width , compression , getValueAsIntWithDefault ( TAG_FILL_ORDER , 1 ) , getValueAsLongWithDefault ( TAG_GROUP4OPTIONS , 0L ) ) ; default : throw new IllegalArgumentException ( ( "Unsupported<seq2seq4repair_space>TIFF<seq2seq4repair_space>compression:<seq2seq4repair_space>" + compression ) ) ; } } private InputStream createUnpredictorStream ( final int predictor , final int width , final int samplesPerPixel , final int bitsPerSample , final InputStream stream , final ByteOrder byteOrder ) throws IOException { } private long [ ] getValueAsLongArray ( final int tag , final String tagName , boolean required ) throws IIOException { } private ICC_Profile getICCProfile ( ) throws IOException { } @ Override public IIOMetadata getImageMetadata ( int imageIndex ) throws IOException { } @ Override public IIOMetadata getStreamMetadata ( ) throws IOException { } public static void main ( final String [ ] args ) throws IOException { } protected static void showIt ( BufferedImage image , String title ) { } private static void deregisterOSXTIFFImageReaderSpi ( ) { } }

Fix:
return new com . twelvemonkeys . io . enc . DecoderStream ( stream , LZWDecoder . create ( LZWDecoder . isOldBitReversedStream ( stream ) ) , Math . max ( ( width * bands ) , 1024 ) ) ;