RFR: 8282577: ICC_Profile.setData(int, byte[]) invalidates the profile [v3]

Sergey Bylokhov serb at openjdk.java.net
Tue Mar 8 05:08:05 UTC 2022


On Thu, 3 Mar 2022 21:27:36 GMT, Phil Race <prr at openjdk.org> wrote:

>> As per the bug eval, we are returning a pointer to a native raw LittleCMS profile and it should be a cooked one.
>> The simple test fails before the fix with
>> ~/jdk17/Contents/Home/bin/java SetTagDataValidation                               
>> Exception in thread "main" java.awt.color.CMMException: LCMS error 13: Couldn't link the profiles
>> 	at java.desktop/sun.java2d.cmm.lcms.LCMS.createNativeTransform(Native Method)
>> 	at java.desktop/sun.java2d.cmm.lcms.LCMS.createTransform(LCMS.java:104)
>> 	at java.desktop/sun.java2d.cmm.lcms.LCMSTransform.doTransform(LCMSTransform.java:143)
>> 	at java.desktop/sun.java2d.cmm.lcms.LCMSTransform.colorConvert(LCMSTransform.java:633)
>> 	at java.desktop/java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:224)
>> 	at SetTagDataValidation.main(SetTagDataValidation.java:61)
>> 
>> and with the fix  just prints 
>> java SetTagDataValidation
>> 0.4
>> 0.5000076
>> 0.6
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8282577: ICC_Profile.setData(int, byte[]) invalidates the profile

src/java.desktop/share/native/liblcms/LCMS.c line 765:

> 763:         // The profile we used for sanity checking needs to be returned
> 764:         // since the one we updated is raw - not cooked.
> 765:         cmsCloseProfile(p);

Looks like now we close this profile in all branches, so can we do that just above the "if (pfSanity == NULL)"?

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

PR: https://git.openjdk.java.net/jdk/pull/7668



More information about the client-libs-dev mailing list