From 31e4479b0873b06633824502fd6d49202e805254 Mon Sep 17 00:00:00 2001 From: Kunal Pai Date: Sun, 25 Oct 2026 23:48:05 -0700 Subject: [PATCH] fix(tiff): follow SubIFDs only when the entry is a LONG C++ reads SubIFDs with GetOffsetAndLength(kTiffTagSubIfd, TIFF_TYPE_LONG), which ignores an entry of any other type. The port followed SHORT and IFD entries too. --- rust/src/tiff/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/src/tiff/parser.rs b/rust/src/tiff/parser.rs index 5779214..2cab16d 100644 --- a/rust/src/tiff/parser.rs +++ b/rust/src/tiff/parser.rs @@ -554,7 +554,7 @@ impl<'a, S: StreamInterface + ?Sized> TiffParser<'a, S> { desired_tags: &[u32], max_number_ifds: u16, ) -> Result<(), TiffError> { - if tiff_ifd.has(EXIF_TAG_SUB_IFDS) { + if tiff_ifd.get_offset_and_length(EXIF_TAG_SUB_IFDS, TiffType::Long).is_ok() { if let Ok(offsets) = tiff_ifd.get_u32_vec(EXIF_TAG_SUB_IFDS) { for &sub_offset in offsets.iter().take(max_number_ifds as usize) { let mut next_offset = 0u32;