Fix: version-aware data colour space validation; reject iccMAX-only spaces on v2/v4 (#1355)#1359
Merged
xsscx merged 1 commit intoJun 15, 2026
Conversation
…paces on v2/v4 (InternationalColorConsortium#1355) CIccProfile::CheckHeader() validated the header data colour space with the version-blind CIccInfo::IsValidSpace(), and reported failures via GetColorSpaceSigName(). Two problems for v2/v4 profiles: 1. The N-channel spaces ncXXXX (icSigNChannelData family) were accepted on any version. They are an iccMAX (v5) construct (ICC.1 7.2.8 / Table 15, for MultiplexLink / MultiplexVisualization / abstract); a v2/v4 data colour space must come from ICC.1 (v4.4.0.0) 7.2.6 / Table 19, which does not list them. A v4 profile carrying e.g. 0x6E630003 passed validation unflagged. 2. A zero data colour space (0x00000000) was reported as "NoData: Unknown color space!". "NoData" is a legitimate v5-only descriptor (Table 15) and lends the value undue legitimacy on a v2/v4 profile where it is simply invalid. Gate both iccMAX-only families (zero and ncXXXX) by major version: on a v2/v4 profile they are now rejected as a critical error, and the diagnostic reports the raw value -- "Invalid data colour space (0x........) for a v2/v4 profile; only iccMAX (v5) permits this!" -- instead of the friendly descriptor. v5 behaviour is unchanged: NoData remains valid for NamedColor / Multiplex classes and ncXXXX spaces remain valid. Verified: v4 0x00000000 and v4 0x6E630003 now flagged with their raw values; the same ncXXXX space on a v5 profile is still accepted; a normal v4 RGB profile reports no colour-space error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 15, 2026
Closed
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.
Summary
Follow-up to the #1355 investigation (see analysis).
CIccProfile::CheckHeader()validated the header data colour space with the version-blindCIccInfo::IsValidSpace()and described failures viaGetColorSpaceSigName(). Two spec-conformance problems for v2/v4 profiles:ncXXXX) were accepted on any version. They are an iccMAX (v5) construct — ICC.1 §7.2.8 / Table 15, for MultiplexLink / MultiplexVisualization / abstract. A v2/v4 data colour space must come from ICC.1 (v4.4.0.0) §7.2.6 / Table 19, which does not list them. A v4 profile carrying e.g.0x6E630003passed validation unflagged.0x00000000) was reported asNoData: Unknown color space!.NoDatais a legitimate v5-only descriptor (Table 15); printing it on a v2/v4 profile lends an invalid value undue legitimacy.Fix
Gate both iccMAX-only families (zero and
ncXXXX) by major version. On a v2/v4 profile they are now a critical error and the diagnostic reports the raw value instead of the friendly descriptor:v5 behaviour is unchanged:
NoDatastays valid for NamedColor / Multiplex classes andncXXXXspaces stay valid.Verification
0x00000000(the #1355 profile)NoData: Unknown color space!Invalid data colour space (0x00000000) for a v2/v4 profile…0x6E630003(nc, 3-ch)Invalid data colour space (0x6E630003) for a v2/v4 profile…0x6E630003(nc, 3-ch)Notes / scope
iccDumpProfileheader dump line still printsData Color Space: NoData(that is the raw header field renderer,GetColorSpaceSigName, not the validator). Making that renderer version-aware everywhere is a broader change; this PR scopes to the validation path, which is what flags conformance. Happy to extend if desired.🤖 Generated with Claude Code