mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
audiorate: Don't leak the input buffer in error cases
Fixes bug #615572.
This commit is contained in:
parent
efe59faa93
commit
0a8b8ceda0
1 changed files with 7 additions and 0 deletions
|
@ -637,6 +637,7 @@ gst_audio_rate_chain (GstPad * pad, GstBuffer * buf)
|
|||
|
||||
/* we can drop the buffer completely */
|
||||
gst_buffer_unref (buf);
|
||||
buf = NULL;
|
||||
|
||||
if (!audiorate->silent)
|
||||
g_object_notify (G_OBJECT (audiorate), "drop");
|
||||
|
@ -701,11 +702,15 @@ send:
|
|||
GST_BUFFER_TIMESTAMP (buf) + GST_BUFFER_DURATION (buf));
|
||||
|
||||
ret = gst_pad_push (audiorate->srcpad, buf);
|
||||
buf = NULL;
|
||||
audiorate->out++;
|
||||
|
||||
audiorate->next_offset = in_offset_end;
|
||||
beach:
|
||||
|
||||
if (buf)
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
gst_object_unref (audiorate);
|
||||
|
||||
return ret;
|
||||
|
@ -713,6 +718,8 @@ beach:
|
|||
/* ERRORS */
|
||||
not_negotiated:
|
||||
{
|
||||
gst_buffer_unref (buf);
|
||||
|
||||
GST_ELEMENT_ERROR (audiorate, STREAM, FORMAT,
|
||||
(NULL), ("pipeline error, format was not negotiated"));
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
|
|
Loading…
Reference in a new issue