From aa61662632293880123b81c6401ec8fb03bd99f1 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 3 Nov 2022 14:06:58 +0100 Subject: [PATCH] deinterlace: Don't leak metas There is no correlation between the frame being NULL and the metas not being present. Part-of: --- .../gst/deinterlace/gstdeinterlace.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/subprojects/gst-plugins-good/gst/deinterlace/gstdeinterlace.c b/subprojects/gst-plugins-good/gst/deinterlace/gstdeinterlace.c index 5cf3eb6..6c209c0 100644 --- a/subprojects/gst-plugins-good/gst/deinterlace/gstdeinterlace.c +++ b/subprojects/gst-plugins-good/gst/deinterlace/gstdeinterlace.c @@ -781,16 +781,17 @@ gst_deinterlace_pop_history (GstDeinterlace * self) static void gst_deinterlace_delete_meta_at (GstDeinterlace * self, gint idx) { - if (self->field_history[idx].frame) { - if (self->field_history[idx].tc) { - gst_video_time_code_free (self->field_history[idx].tc); - self->field_history[idx].tc = NULL; - } - if (self->field_history[idx].caption) { - g_free (self->field_history[idx].caption->data); - g_free (self->field_history[idx].caption); - self->field_history[idx].caption = NULL; - } + GST_DEBUG_OBJECT (self, "idx:%d frame %p", idx, + self->field_history[idx].frame); + + if (self->field_history[idx].tc) { + gst_video_time_code_free (self->field_history[idx].tc); + self->field_history[idx].tc = NULL; + } + if (self->field_history[idx].caption) { + g_free (self->field_history[idx].caption->data); + g_free (self->field_history[idx].caption); + self->field_history[idx].caption = NULL; } } -- 2.7.4