summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2021-05-02 20:45:01 +0300
committerTim-Philipp Müller <tim@centricular.com>2021-05-03 10:31:36 +0100
commit61e8ba683538e3bc4525fd7a7a062d0507593c0d (patch)
tree81e56b4423d5fabeb4646ecc2c1755925f7ec04f
parentf44b966120ef426a1776bc7997dc872507cab439 (diff)
downloadgstreamer-plugins-base-61e8ba683538e3bc4525fd7a7a062d0507593c0d.tar.gz
appsrc: Don't leak buffer list while wrongly unreffing buffer on EOS/flushing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1135>
-rw-r--r--gst-libs/gst/app/gstappsrc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gst-libs/gst/app/gstappsrc.c b/gst-libs/gst/app/gstappsrc.c
index a6f531d38..c2267a045 100644
--- a/gst-libs/gst/app/gstappsrc.c
+++ b/gst-libs/gst/app/gstappsrc.c
@@ -2003,16 +2003,24 @@ gst_app_src_push_internal (GstAppSrc * appsrc, GstBuffer * buffer,
flushing:
{
GST_DEBUG_OBJECT (appsrc, "refuse buffer %p, we are flushing", buffer);
- if (steal_ref)
- gst_buffer_unref (buffer);
+ if (steal_ref) {
+ if (buflist)
+ gst_buffer_list_unref (buflist);
+ else
+ gst_buffer_unref (buffer);
+ }
g_mutex_unlock (&priv->mutex);
return GST_FLOW_FLUSHING;
}
eos:
{
GST_DEBUG_OBJECT (appsrc, "refuse buffer %p, we are EOS", buffer);
- if (steal_ref)
- gst_buffer_unref (buffer);
+ if (steal_ref) {
+ if (buflist)
+ gst_buffer_list_unref (buflist);
+ else
+ gst_buffer_unref (buffer);
+ }
g_mutex_unlock (&priv->mutex);
return GST_FLOW_EOS;
}