libheif
libheif copied to clipboard
encoder_kvazaar.cc: Fix some memory leaks
This fixes the following memory leaks:
- the
data
chunks are not freed in all cases after being appended to the encoder output -
append_chunk_data
throwing an exception (std::bad_alloc) would not free any of the kvazaar-structures
At least the successful encoding case should be leak-free now: The address sanitizer does not report any leaks. I did not test the exceptional cases - using unique_ptr this should be no different than the successful case.