misyltoad/VTFLib

Memory leak in Create function.

Opened this issue · 0 comments

https://github.com/Joshua-Ashton/VTFLib/blob/master/VTFLib/VTFFile.cpp#L590-L607

(I reported this to Neijed, but thought I'd report this separately here)

The memory leak in question is the generation of new data for the resizing of the image data, but instead of getting rid of the old data, it sets a new memory address without clearing the old one first. This is also UB as the image data is not VTFLib's to mutate, it should be copied and disposed of at the end.