You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of the readPntsColors function contains a buffer length error when processing RGBA color data. The Uint8Array initialization for RGBA incorrectly uses nComponents (calculated as 3 * nPts) instead of 4 * nPts, leading to incomplete data reads and potential memory boundary violations.
Also, the loop logic is wrong. It should iterates over 4 * nPts rather than nComponents (3 * nPts) with a step of 4. Besides, rgb index should be (i / 4) * 3, (i / 4) * 3 + 1, (i / 4) * 3 + 2 rather than i + 0, i + 1, i + 2.
Describe the bug
The current implementation of the readPntsColors function contains a buffer length error when processing RGBA color data. The Uint8Array initialization for RGBA incorrectly uses nComponents (calculated as 3 * nPts) instead of 4 * nPts, leading to incomplete data reads and potential memory boundary violations.
itwinjs-core/core/frontend/src/internal/tile/PntsReader.ts
Line 94 in 49cd19f
Also, the loop logic is wrong. It should iterates over 4 * nPts rather than nComponents (3 * nPts) with a step of 4. Besides, rgb index should be (i / 4) * 3, (i / 4) * 3 + 1, (i / 4) * 3 + 2 rather than i + 0, i + 1, i + 2.
itwinjs-core/core/frontend/src/internal/tile/PntsReader.ts
Line 95 in 49cd19f
The text was updated successfully, but these errors were encountered: