Skip to content

Commit

Permalink
Actually byte swap keyAndValueByteSize values. Fix issue #447.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkCallow committed Jul 29, 2021
1 parent 871f111 commit 0011808
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/texture1.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ ktxTexture1_constructFromStreamAndHeader(ktxTexture1* This, ktxStream* pStream,
ktx_uint8_t* src = pKvd;
ktx_uint8_t* end = pKvd + kvdLen;
while (src < end) {
ktx_uint32_t keyAndValueByteSize = *((ktx_uint32_t*)src);
_ktxSwapEndian32(&keyAndValueByteSize, 1);
src += _KTX_PAD4(keyAndValueByteSize);
ktx_uint32_t* pKeyAndValueByteSize = (ktx_uint32_t*)src;
_ktxSwapEndian32(pKeyAndValueByteSize, 1);
src += _KTX_PAD4(*pKeyAndValueByteSize);
}
}

Expand Down

0 comments on commit 0011808

Please sign in to comment.