mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-03-20 00:00:03 -04:00
Merge pull request #368 from Schmidor/invalidIDFpointer
An invalid IFD pointer caused creating an empty IFD Directory
This commit is contained in:
@@ -311,4 +311,13 @@ public class TIFFReaderTest extends MetadataReaderAbstractTest {
|
||||
assertTrue(directory.getEntryById(32934).getValue() instanceof EOFException);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReadIDFPointerBeyondEOF() throws IOException {
|
||||
try (ImageInputStream stream = ImageIO.createImageInputStream(getResource("/tiff/ifd-end-pointer.tif"))) {
|
||||
CompoundDirectory directory = (CompoundDirectory) createReader().read(stream);
|
||||
assertEquals(1, directory.directoryCount());
|
||||
assertEquals(15, directory.size());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user