Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix mismatched malloc and delete (#440)
* Fixes crash in ktxTexture2_TranscodeBasis due to mismatched malloc and delete The crash happened inside the delete, 100% with MSVC, with and without optimizations. The repro steps were simply to call the ktxTexture2_TranscodeBasis function with a basis universal ktx2 file: ``` ktxTexture* texture; KTX_error_code result = ktxTexture_CreateFromMemory( (const uint8_t*)data, size, KTX_TEXTURE_CREATE_LOAD_IMAGE_DATA_BIT, &texture); if (result != KTX_SUCCESS) { return false; } if (ktxTexture_NeedsTranscoding(texture)) { result = ktxTexture2_TranscodeBasis( (ktxTexture2*)texture, ktx_transcode_fmt_e::KTX_TTF_ASTC_4x4_RGBA, 0); if (result != KTX_SUCCESS) { return false; } } ``` I didn't find any other location using delete instead of free, or new instead of malloc for this member. The other locations are all using malloc and free.
- Loading branch information