From 639b1183b4ef36d02c435a659ab3c755d06b9f0d Mon Sep 17 00:00:00 2001 From: Bjarne Rosengren Date: Thu, 7 Feb 2008 16:38:55 +0000 Subject: [PATCH] gst/matroska/ebml-write.c: Don't leak buffers when we don't push them downstream. Original commit message from CVS: Patch by: Bjarne Rosengren * gst/matroska/ebml-write.c: (gst_ebml_write_element_push): Don't leak buffers when we don't push them downstream. Fixes bug #514965. --- ChangeLog | 8 ++++++++ gst/matroska/ebml-write.c | 3 +++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2a9055a..93d7426 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-07 Sebastian Dröge + + Patch by: Bjarne Rosengren + + * gst/matroska/ebml-write.c: (gst_ebml_write_element_push): + Don't leak buffers when we don't push them downstream. + Fixes bug #514965. + 2008-02-07 Tim-Philipp Müller * configure.ac: diff --git a/gst/matroska/ebml-write.c b/gst/matroska/ebml-write.c index 1a039e4..ca08613 100644 --- a/gst/matroska/ebml-write.c +++ b/gst/matroska/ebml-write.c @@ -371,6 +371,9 @@ gst_ebml_write_element_push (GstEbmlWrite * ebml, GstBuffer * buf) buf = gst_buffer_make_metadata_writable (buf); gst_buffer_set_caps (buf, GST_PAD_CAPS (ebml->srcpad)); ebml->last_write_result = gst_pad_push (ebml->srcpad, buf); + } else { + if (buf != ebml->cache) + gst_buffer_unref (buf); } } -- 2.7.4