Skip to content

Commit

Permalink
#786 TIFF: No longer create custom Inflater, to avoid resource leak
Browse files Browse the repository at this point in the history
(cherry picked from commit 2a4c152)
  • Loading branch information
haraldk committed Jul 19, 2023
1 parent 2f56650 commit c8cb472
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;

import static com.twelvemonkeys.imageio.util.IIOUtil.createStreamAdapter;
Expand Down Expand Up @@ -2429,7 +2428,7 @@ private InputStream createDecompressorStream(final int compression, final int wi
case TIFFExtension.COMPRESSION_DEFLATE:
// TIFF specification, supplement 2 says ZLIB (8) and DEFLATE (32946) algorithms are identical
case TIFFCustom.COMPRESSION_PIXTIFF_ZIP:
return new InflaterInputStream(stream, new Inflater(), 1024);
return new InflaterInputStream(stream);
case TIFFBaseline.COMPRESSION_CCITT_MODIFIED_HUFFMAN_RLE:
case TIFFExtension.COMPRESSION_CCITT_T4:
case TIFFExtension.COMPRESSION_CCITT_T6:
Expand Down

0 comments on commit c8cb472

Please sign in to comment.