Integer overflow for TIFF stream when splitting large TIFF #676
Open
Description
Describe the bug
I am trying to extract the first page from a large TIFF (15GB) using TIFFUtilities::split
function
Version information
-
The version of the TwelveMonkeys ImageIO library in use.
3.8.2
-
The exact output of
java --version
(orjava -version
for older Java releases).
java version "15.0.2" 2021-01-19
Java(TM) SE Runtime Environment (build 15.0.2+7-27)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
- Extra information about OS version, server version, standalone program or web application packaging, executable wrapper, etc.
Windows 10 64bit
To Reproduce
Steps to reproduce the behavior:
TIFFUtilities.split(new File("Large_test.tif"), new File("E:\\tmp\\"));
Expected behavior
the individual pages
Stack trace
Exception in thread "main" javax.imageio.IIOException: Integer overflow for TIFF stream
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.assertIntegerOffset(TIFFWriter.java:514)
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.writeOffset(TIFFWriter.java:504)
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.writeIFD(TIFFWriter.java:145)
at com.twelvemonkeys.imageio.metadata.tiff.TIFFWriter.writeIFD(TIFFWriter.java:127)