Skip to content

Integer overflow for TIFF stream when splitting large TIFF #676

Open
@beig

Description

Describe the bug
I am trying to extract the first page from a large TIFF (15GB) using TIFFUtilities::split function

Version information

  1. The version of the TwelveMonkeys ImageIO library in use.
    3.8.2

  2. The exact output of java --version (or java -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)
  1. 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)

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions