drewnoakes/metadata-extractor

Deep recursion / stackoverflow with tiff image

開放

#559 建立於 2021年12月1日

 (5 則留言) (1 個反應) (0 位負責人)Java (470 個分叉)batch import
format-tiffhelp wantedimage-queue

倉庫指標

星標
 (2,411 顆星)
PR 合併指標
 (平均合併 3天 2小時) (30 天內合併 2 個 PR)

描述

Hello.

Tiff image can be downloaded here: https://github.com/cgohlke/imagecodecs/blob/master/tests/tiff/gray.movie.u2.tif

Then try to extract metadata by using this code:

InputStream inputStream = new ByteArrayInputStream(imageBlob);

Metadata metadata = ImageMetadataReader.readMetadata(inputStream);

Directory mimeTypeDir = metadata.getFirstDirectoryOfType(FileTypeDirectory.class);

String mimeType = mimeTypeDir.getString(3);
String extension = mimeTypeDir.getString(4);

This should throw a java.lang.StackOverflowError

I also tried using a a tool like ExifTool and it threw a similar warning: Deep recursion on subroutine "Image::ExifTool::ProcessDirectory" Deep recursion on subroutine "Image::ExifTool::Exif::ProcessExif"

Let me know if you need more details.

貢獻者指南