transform-swf
transform-swf copied to clipboard
BufferedImageDecoder causing severe native memory leak due to Deflater not being closed properly
Method com.flagstone.transform.util.image.BufferedImageDecoder#zip(byte[]) uses java.util.zip.Deflater to compress data - but the Deflater is not ended properly (missing call to Deflater#end()) causing allocated native memory not to be released.
Code to reproduce:
public static void main(String[] args) throws Exception {
String imageFile = args[0];
BufferedImage indexedColorModelImage = ImageIO.read(new File(imageFile));
for (int i = 0; i < 100000; i++) {
BufferedImageDecoder decoder = new BufferedImageDecoder();
decoder.read(indexedColorModelImage);
ImageTag tag = decoder.defineImage(i);
}
}
Provide 1 command line param - a path to a PNG file. Attaching sample PNG below (PNG 8bit indexed).
Issue occurs on Java 1.6 and 1.7 - regardless of the update number.
