Skip to content

Commit fdbfb76

Browse files
committed
Fix for optimisation error on grayscale
Thanks to Aaron Boxer for reporting this issue
1 parent ac4fe46 commit fdbfb76

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/cmsintrp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ void Eval1Input(CMSREGISTER const cmsUInt16Number Input[],
278278
// if last value...
279279
if (Input[0] == 0xffff || p16->Domain[0] == 0) {
280280

281-
cmsUInt16Number y0 = LutTable[p16->Domain[0]];
282-
281+
cmsUInt32Number y0 = p16->Domain[0] * p16->opta[0];
282+
283283
for (OutChan = 0; OutChan < p16->nOutputs; OutChan++) {
284-
Output[OutChan] = y0;
284+
Output[OutChan] = LutTable[y0 + OutChan];
285285
}
286286
}
287287
else
@@ -324,10 +324,10 @@ void Eval1InputFloat(const cmsFloat32Number Value[],
324324
// if last value...
325325
if (val2 == 1.0 || p->Domain[0] == 0) {
326326

327-
y0 = LutTable[p->Domain[0]];
327+
cmsUInt32Number start = p->Domain[0] * p->opta[0];
328328

329329
for (OutChan = 0; OutChan < p->nOutputs; OutChan++) {
330-
Output[OutChan] = y0;
330+
Output[OutChan] = LutTable[start + OutChan];
331331
}
332332
}
333333
else

0 commit comments

Comments
 (0)