mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-11 02:24:13 +00:00
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/1134>
This commit is contained in:
parent
fc7d65b107
commit
da9a3da8aa
1 changed files with 12 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue