From 310ff531fb959a1748ea3862f792893ade542c2a 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 f8a76ce0a..b62c152e3 100644 --- a/gstreamer-base/src/subclass/base_src.rs +++ b/gstreamer-base/src/subclass/base_src.rs @@ -411,7 +411,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 078827bd6..5c1b4355f 100644 --- a/gstreamer-base/src/subclass/push_src.rs +++ b/gstreamer-base/src/subclass/push_src.rs @@ -152,7 +152,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,