From 45eef1a000f06c8972608b23c2d77223b00c1b76 Mon Sep 17 00:00:00 2001 From: Doug Nazar Date: Wed, 28 May 2025 08:45:40 -0400 Subject: [PATCH] alphacombine: fix memory leaks Part-of: --- .../gst-plugins-bad/gst/codecalpha/gstalphacombine.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c index 8a2e099106..a8aa96f3dd 100644 --- a/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c +++ b/subprojects/gst-plugins-bad/gst/codecalpha/gstalphacombine.c @@ -386,8 +386,10 @@ gst_alpha_combine_sink_chain (GstPad * pad, GstObject * object, guint alpha_plane_idx; ret = gst_alpha_combine_peek_alpha_buffer (self, &alpha_buffer); - if (ret != GST_FLOW_OK) + if (ret != GST_FLOW_OK) { + gst_buffer_unref (src_buffer); return ret; + } GST_DEBUG_OBJECT (self, "Combining buffer %p with alpha buffer %p", src_buffer, alpha_buffer); @@ -713,6 +715,9 @@ gst_alpha_combine_dispose (GObject * object) } g_clear_object (&self->blocked_pad); + gst_buffer_replace (&self->alpha_buffer, NULL); + gst_buffer_replace (&self->last_alpha_buffer, NULL); + G_OBJECT_CLASS (parent_class)->dispose (object); }