KhronosGroup / KTX-Software

KTX (Khronos Texture) Library and Tools
Other
864 stars 226 forks source link

Incorrect NORMALIZED format result from `interpretDFD` #738

Closed MarkCallow closed 1 year ago

MarkCallow commented 1 year ago

The test at line 130 in interpretdfd.c is using the counter from a previous loop. The counter in the loop this is in is i.

        if (KHR_DFDSVAL(BDFDB, sampleCounter, BITLENGTH) > 0)
            hasNormalized |= isNormalized;

The fix is s/asampleCounter/i/.

sampleCounter, having been used in a previous loop, always equals the number of samples. Therefore I am surprised this error has not been causing crashes.