Minor alignment issue for B Curve parsing in CIccTagLutAtoB::Read
Opened this issue · 0 comments
Cognoscan commented
Though I doubt this comes up in actual ICC profiles, I noticed that when parsing the B curves for the AtoB / BtoA LUT types, the offset realignment is wrong - it realigns based on the offset for the matrix instead of the B curve offset. You can see that the M & A curves are both correct and align to their respective offsets, so it's just the B curve that has this wrong. It's a minor thing that tripped me up when I was checking how the parsing code handles curve alignment.
See the diff below for the proposed fix. It feels a bit silly to do a pull request for a literal one-character change, but I can do that if it would be helpful.
diff --git a/IccProfLib/IccTagLut.cpp b/IccProfLib/IccTagLut.cpp
index 28bb070..3289370 100644
--- a/IccProfLib/IccTagLut.cpp
+++ b/IccProfLib/IccTagLut.cpp
@@ -3846,7 +3846,7 @@ bool CIccTagLutAtoB::Read(icUInt32Number size, CIccIO *pIO)
if (!pCurves[i]->Read(nEnd - pIO->Tell(), pIO))
return false;
- if (!pIO->Sync32(Offset[1]))
+ if (!pIO->Sync32(Offset[0]))
return false;
}
}