RFR: JDK-8347377 : Add validation checks for ICC_Profile header fields [v3]

Sergey Bylokhov serb at openjdk.org
Tue Jan 14 18:01:55 UTC 2025


On Tue, 14 Jan 2025 17:56:07 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>>> "our own profiles do not strictly follow these specification"
>>> 
>>> What you are pointing to isn't a profile. It is code that accepts a requested rendering intent. I don't see how it is related.
>> 
>> the new code will be called when loading raw data for a profile, so if that profile was previously accepted and used some default values, the new code will reject it.
>
>>The cooked approach doesn't work for ICC_Profile header data. In case header data is updated using the cooked approach we run into IAE- cannot write tag data for both invalid as well as valid header field values.
> 
> maybe If the cooked approach always throws an exception and the current approach via "cmsSet" just ignores all errors means we are doing something wrong? Can we ask lcms maintainers why the validation is not done for this methods?
> 
> for example for the next method is it assumed that the client code should check the content of Table 10, and reject all incorrect values?:
> 
> **void cmsSetColorSpace(cmsHPROFILE hProfile, cmsColorSpaceSignature sig);**
> 
> Sets the color space signature in profile header, using ICC convention.
> Parameters:
> hProfile: Handle to a profile object
> sig: any cmsColorSpaceSignature from Table 10
> Returns:
> *None*
> 
> https://www.littlecms.com/LittleCMS2.16%20API.pdf

probably the answer will be that not all profiles are used for transformation, and just to read some of its properties it is not necessary to reject unexpected data such as intent/etc.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/23044#discussion_r1915359597


More information about the client-libs-dev mailing list