From 7873a426d4819698cfcb77ef7468d8993b789a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 Jun 2022 10:23:27 +0300 Subject: [PATCH] base: Fix memory leak if BaseSrc/PushSrc parent class is not filling the provided buffer as it should --- gstreamer-base/src/subclass/base_src.rs | 2 +- gstreamer-base/src/subclass/push_src.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gstreamer-base/src/subclass/base_src.rs b/gstreamer-base/src/subclass/base_src.rs index 896066044..b862619aa 100644 --- a/gstreamer-base/src/subclass/base_src.rs +++ b/gstreamer-base/src/subclass/base_src.rs @@ -414,7 +414,7 @@ impl BaseSrcImplExt for T { if let Some(passed_buffer) = buffer { if buffer_ptr != orig_buffer_ptr { - let new_buffer = gst::BufferRef::from_ptr(buffer_ptr); + let new_buffer = gst::Buffer::from_glib_full(buffer_ptr); gst_debug!( gst::CAT_PERFORMANCE, diff --git a/gstreamer-base/src/subclass/push_src.rs b/gstreamer-base/src/subclass/push_src.rs index 3aefeab9d..9b242ca37 100644 --- a/gstreamer-base/src/subclass/push_src.rs +++ b/gstreamer-base/src/subclass/push_src.rs @@ -154,7 +154,7 @@ impl PushSrcImplExt for T { if let Some(passed_buffer) = buffer { if buffer_ptr != orig_buffer_ptr { - let new_buffer = gst::BufferRef::from_ptr(buffer_ptr); + let new_buffer = gst::Buffer::from_glib_full(buffer_ptr); gst_debug!( gst::CAT_PERFORMANCE,