RFR: JDK-8347377 : Add validation checks for ICC_Profile header fields [v3]
Harshitha Onkar
honkar at openjdk.org
Tue Jan 14 18:51:40 UTC 2025
On Tue, 14 Jan 2025 18:35:54 GMT, Harshitha Onkar <honkar at openjdk.org> wrote:
>> 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.
>
> @mrserb
> Some of these checks already exist and are done by jdk when loading profile using ICC_Profile.getInstance(byte[] data). For instance profile/device class and color space. Shouldn't setData() do something similar?
> **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*
> 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?:
Based on the API doc,looks like LCMS expects client code (jdk) to validate the values before updating it using cmsSet**() APIs. I can double-check with the LCMS maintainers for clarity.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23044#discussion_r1915434490
More information about the client-libs-dev
mailing list