fix: preserve embedded TIFF profiles on parse failure - #2188
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates iccTiffDump to always extract the embedded TIFF ICC profile bytes as-is (before parsing/validation), so malformed or nonconformant profiles are preserved for diagnostics even when the tool exits with an error. It also adds a recursion-depth bound for full tag loading to mitigate pathological nested embedded-profile inputs (Issue #2187).
Changes:
- Write embedded ICC bytes byte-for-byte to the requested output path before parsing/validation, using a temp-file + atomic rename flow.
- Add a thread-local recursion depth guard to
CIccProfile::ReadTags()to bound recursive embedded-profile tag expansion. - Update hardening regression coverage and tool documentation to reflect the new “preserve on failure” extraction semantics.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Tools/CmdLine/IccTiffDump/Readme.md | Documents byte-for-byte extraction and atomic output behavior. |
| Tools/CmdLine/IccTiffDump/iccTiffDump.cpp | Implements raw extraction prior to validation and switches export behavior accordingly. |
| IccProfLib/IccProfile.cpp | Adds a recursion depth limit for recursive full tag loading (ReadTags). |
| .github/scripts/iccdev-tiffdump-output-hardening-tests.sh | Extends regression coverage to assert preservation and bounded recursion behaviors. |
Suppressed comments (1)
.github/scripts/iccdev-tiffdump-output-hardening-tests.sh:340
- Similar to the iccTiffDump bounded-recursion test above:
timeoutreturns 124 on timeout, which currently satisfies the1..127exit-code assertion. If iccToXml hangs andtimeoutkills it after producing partial output, this check could incorrectly pass. Makestatus==124fail explicitly.
timeout 10 "$TOXML" "$nested" "$xml" > "$log" 2>&1 || status=$?
[ "$status" -ge 1 ] && [ "$status" -le 127 ] || return 1
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
PR Review Status2026-08-17 16:29:49 UTC
|
5366357 to
0127b4c
Compare
PR Review Status2026-08-17 16:38:30 UTC Copilot PR Review Documentation
Keywords: PR Review Copilot Graph |
Automated Review Blind Spot(s)
CI Report2026-08-17 16:42:31 UTC Job |
0127b4c to
52a6f9c
Compare
PR Status2026-08-17 17:07:39 UTC Windows 11 Repro
Build & Generate ProfilesQA Test ResultsSuccess for Linux, macOS & Windows |
CI Report2026-08-17 17:10:41 UTC ci-regression-checks |
52a6f9c to
954cfe7
Compare
Unix Repro2026-08-17 17:43:04 UTC Expected Output |
Pre Merge Report2026-08-17 17:58:15 UTC TODO Summary
|
PR Summary
#2187
Checklist
docs/build.mddocs/ctest.mddocs/python-packaging-release.mdfor PR and merge requirementsm_membersLegal Requirements
All official software projects hosted by the International Color Consoritum (ICC)
follows the open source software best practice policies. The International Color Consoritum IP policy governs ICC specification development and contributions to ICC open source software. Software contributions are also covered by the Contributor License Agreement (CLA).
Contributor License Agreements
Developers who wish to contribute code to be considered for inclusion
in ICC software must first complete a Contributor License Agreement
(CLA).
There is no cost or membership requirement to sign the ICC Contributor License Agreement (CLA). Please note that this is different from membership in the International Color Consortium (ICC). If your organization relies on our projects, please become a member. Membership dues are an essential source of funding and investment for these projects.
If you are an individual writing the code on your own time and you are SURE you are the sole owner of any intellectual property you contribute, you can sign the CLA as an individual contributor.
If you are writing the code as part of your job, or if there is any possibility that your employer might think they own any intellectual property you create, then you should use the Corporate Contributor Licence Agreement
License
ICC software is licensed under the BSD 3-Clause "New" or "Revised" License. Contributions to ICC software projects should abide by that license unless otherwised specified or approved by the ICC.
Copyright Notices
All new source files must begin with the ICC Copyright notice and include or reference the BSD 3-Clause "New" or "Revised" License.
INTELLECTUAL PROPERTY & PATENTS
Participation in ICC's development activities is subject to ICC's Patent Policy.
Maintainer Review Required
If you have questions, contact a listed Maintainer.