From 0bc31d105a94f98854c5a5f953920663f7174994 Mon Sep 17 00:00:00 2001 From: Yigithan Yigit Date: Thu, 12 Sep 2024 03:00:06 +0300 Subject: [PATCH] bugfix --- libvmaf/src/metadata_handler.c | 3 ++- libvmaf/test/test_propagate_metadata.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libvmaf/src/metadata_handler.c b/libvmaf/src/metadata_handler.c index 463571c69..8fe3a069a 100644 --- a/libvmaf/src/metadata_handler.c +++ b/libvmaf/src/metadata_handler.c @@ -69,7 +69,8 @@ int vmaf_metadata_destroy(VmafCallbackList *metadata) VmafCallbackItem *iter = metadata->head; while (iter) { VmafCallbackItem *next = iter->next; - free(iter->metadata_cfg.feature_name); + if (iter->metadata_cfg.feature_name) + free(iter->metadata_cfg.feature_name); free(iter); iter = next; } diff --git a/libvmaf/test/test_propagate_metadata.c b/libvmaf/test/test_propagate_metadata.c index ee4faced3..1c857432e 100644 --- a/libvmaf/test/test_propagate_metadata.c +++ b/libvmaf/test/test_propagate_metadata.c @@ -55,7 +55,7 @@ static char *test_propagate_metadata_append() int err = vmaf_metadata_init(&propagate_metadata); mu_assert("problem during vmaf_propagate_metadata_init", !err); - VmafMetadataConfiguration metadata_config; + VmafMetadataConfiguration metadata_config = {0}; metadata_config.callback = set_meta; metadata_config.data = NULL;