mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-04-30 00:00:01 -04:00
#477: Avoid cyclic loops in IFDs.
This commit is contained in:
+11
@@ -344,4 +344,15 @@ public class TIFFReaderTest extends MetadataReaderAbstractTest {
|
||||
assertEquals(3, directory.getDirectory(1).size());
|
||||
}
|
||||
}
|
||||
|
||||
@Test(timeout = 500)
|
||||
public void testReadCyclicExifWithoutLoopOrOOME() throws IOException {
|
||||
try (ImageInputStream stream = ImageIO.createImageInputStream(getResource("/exif/exif-loop.bin"))) {
|
||||
CompoundDirectory directory = (CompoundDirectory) createReader().read(stream);
|
||||
assertEquals(1, directory.directoryCount());
|
||||
assertEquals(12, directory.getDirectory(0).size());
|
||||
assertEquals("Polarr Photo Editor", directory.getDirectory(0).getEntryById(TIFF.TAG_SOFTWARE).getValue());
|
||||
assertEquals("2019:02:27 09:22:59", directory.getDirectory(0).getEntryById(TIFF.TAG_DATE_TIME).getValueAsString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user