VTFLib icon indicating copy to clipboard operation
VTFLib copied to clipboard

Memory leak at Create function.

Open Trico-Everfire opened this issue 2 years ago • 0 comments

https://github.com/NeilJed/VTFLib/blob/main/VTFLib/VTFFile.cpp#L661-L677

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.

Trico-Everfire avatar Apr 11 '23 19:04 Trico-Everfire