mm2 / Little-CMS

A free, open source, CMM engine. It provides fast transforms between ICC profiles.
https://www.littlecms.com
MIT License
562 stars 175 forks source link

Eval1InputFloat returns an incorrect value #136

Closed suzukihf closed 6 years ago

suzukihf commented 6 years ago

When Eval1InputFloat(cmsintrp.c:288-325) is the input value 1.0, since the reference position is wrong, it returns an incorrect value.

output[0] is incorrect value output[1], output[2] is undefined


Condition V4Profile(GRAY-LAB) D2B0(multiProcessElementsType, CLUT element) Gray to Lab(1Channel -> 3Channel)



Bug Code // if last value... if (val2 == 1.0) { Output[0] = LutTable[p -> Domain[0]]; return; }

Fixed Code // if last value... if (val2 == 1.0) { for (OutChan=0; OutChan < p->nOutputs; OutChan++) { Output[OutChan] = LutTable[ p -> Domain[0] * p -> opta[0] ]; } return; }


mm2 commented 6 years ago

should be fixed now, thanks

suzukihf commented 6 years ago

Thank you for your response.