Repository navigation
[V4] Decode TIFF large strips and backwards directory chains - #3255
Merged
Merged
Conversation
A missing RowsPerStrip, or one above the image height, is now limited to the height, so planar files without the entry decode and the strip buffer only holds rows that exist. Uncompressed strips, chunky or planar, that are larger than the single buffer allocation limit are read one row at a time. The image dimensions are recorded before the root frame is allocated, so an allocation failure reports the real size, and a frame that fails to decode is released. Directory chains that go backwards in the file are accepted; only a revisited directory is reported as circular.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
Backport #3231 to release/4.1.x. Merge #3231 first.
Apply RowsPerStrip defaults to chunky and planar images. Read large uncompressed strips in reusable row buffers. Accept decreasing directory offsets while rejecting circular chains in TIFF and BigTIFF.
Report the root dimensions on allocation failure and dispose failed frames, including failures during ICC conversion. Reject zero RowsPerStrip in every integrity mode. Strict and IgnoreAncillary reject short uncompressed image data. IgnoreImageData retains available samples and clears missing samples without reading beyond StripByteCounts. Correct the source sizes for subsampled YCbCr and the allocation sizes for planar tiles.
Use the reviewed stored inputs and existing decoder, allocator, and comparison APIs. No runtime image builders remain in these tests. Public APIs remain unchanged.
Verification: 775 TIFF and general decoder regression tests passed in Release on .NET 8 and .NET 10. This includes 28 strip-layout cases covering all integrity modes. No existing tolerances or reference images changed.
Refs #3243