[LMCS] Fix source_lmcs and rec_lmcs deallocation

This commit is contained in:
Marko Viitanen 2021-05-06 13:15:39 +03:00
parent d2670ccdc8
commit f36c4e71ed

View file

@ -68,14 +68,10 @@ int kvz_videoframe_free(videoframe_t * const frame)
{
// Free LMCS mapped images, they are either pointing to normal or allocated separately
if (frame->source_lmcs != frame->source) {
if (frame->source_lmcs_mapped) {
kvz_image_free(frame->source_lmcs);
frame->source_lmcs = NULL;
}
if (frame->rec_lmcs != frame->rec) {
kvz_image_free(frame->rec_lmcs);
frame->rec_lmcs = NULL;
frame->source_lmcs_mapped = false;
}
kvz_image_free(frame->source);
@ -83,6 +79,9 @@ int kvz_videoframe_free(videoframe_t * const frame)
kvz_image_free(frame->rec);
frame->rec = NULL;
frame->source_lmcs = NULL;
frame->rec_lmcs = NULL;
kvz_cu_array_free(&frame->cu_array);
FREE_POINTER(frame->sao_luma);