From 2e198d4e59e107126baafa1b863f75bbdef19c17 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 29 Oct 2024 15:36:49 +0100 Subject: [PATCH] validate: Fix leaks in ssim components Part-of: --- subprojects/gst-devtools/validate/gst-libs/gst/video/gssim.c | 1 + .../gst-devtools/validate/plugins/ssim/gstvalidatessim.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/subprojects/gst-devtools/validate/gst-libs/gst/video/gssim.c b/subprojects/gst-devtools/validate/gst-libs/gst/video/gssim.c index 0e23a2f7ac..5999f6aa36 100644 --- a/subprojects/gst-devtools/validate/gst-libs/gst/video/gssim.c +++ b/subprojects/gst-devtools/validate/gst-libs/gst/video/gssim.c @@ -417,6 +417,7 @@ gssim_finalize (GObject * object) g_free (self->priv->orgmu); g_free (self->priv->windows); + g_free (self->priv->weights); chain_up (object); } diff --git a/subprojects/gst-devtools/validate/plugins/ssim/gstvalidatessim.c b/subprojects/gst-devtools/validate/plugins/ssim/gstvalidatessim.c index 37cad8a513..dffe2abd66 100644 --- a/subprojects/gst-devtools/validate/plugins/ssim/gstvalidatessim.c +++ b/subprojects/gst-devtools/validate/plugins/ssim/gstvalidatessim.c @@ -173,6 +173,7 @@ runner_stopping (GstValidateRunner * runner, ValidateSsimOverride * self) ref_path = g_build_path (G_DIR_SEPARATOR_S, compared_files_dir, refname, NULL); + g_free (refname); if (!gst_validate_ssim_compare_image_files (ssim, ref_path, frame->path, &mssim, &lowest, &highest, self->priv->result_outdir)) @@ -191,6 +192,8 @@ runner_stopping (GstValidateRunner * runner, ValidateSsimOverride * self) g_free (bname); } + gst_object_unref (ssim); + gst_validate_printf (NULL, "\nAverage similarity: %f, min_avg: %f, min_min: %f\n", total_avg / nfiles, min_avg, min_min); @@ -410,6 +413,8 @@ _finalize (GObject * object) if (priv->config) gst_structure_free (priv->config); + + G_OBJECT_CLASS (validate_ssim_override_parent_class)->finalize (object); } static void