mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 08:46:40 +00:00
qtmux: Fix buffer leak in fragment_buffers
When pushing buffers from one of the sink pads fail, make sure that all buffers added to fragment_buffers on other pads are freed as well. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3624>
This commit is contained in:
parent
194dcd91e0
commit
d752bf1b46
1 changed files with 8 additions and 0 deletions
|
@ -641,6 +641,8 @@ gst_qt_mux_class_init (GstQTMuxClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_qt_mux_pad_reset (GstQTMuxPad * qtpad)
|
gst_qt_mux_pad_reset (GstQTMuxPad * qtpad)
|
||||||
{
|
{
|
||||||
|
guint i;
|
||||||
|
|
||||||
qtpad->fourcc = 0;
|
qtpad->fourcc = 0;
|
||||||
qtpad->is_out_of_order = FALSE;
|
qtpad->is_out_of_order = FALSE;
|
||||||
qtpad->sample_size = 0;
|
qtpad->sample_size = 0;
|
||||||
|
@ -678,7 +680,13 @@ gst_qt_mux_pad_reset (GstQTMuxPad * qtpad)
|
||||||
atom_traf_free (qtpad->traf);
|
atom_traf_free (qtpad->traf);
|
||||||
qtpad->traf = NULL;
|
qtpad->traf = NULL;
|
||||||
}
|
}
|
||||||
|
for (i = 0; i < atom_array_get_len (&qtpad->fragment_buffers); i++) {
|
||||||
|
GstBuffer *buf = atom_array_index (&qtpad->fragment_buffers, i);
|
||||||
|
if (buf != NULL)
|
||||||
|
gst_buffer_unref (atom_array_index (&qtpad->fragment_buffers, i));
|
||||||
|
}
|
||||||
atom_array_clear (&qtpad->fragment_buffers);
|
atom_array_clear (&qtpad->fragment_buffers);
|
||||||
|
|
||||||
if (qtpad->samples)
|
if (qtpad->samples)
|
||||||
g_array_unref (qtpad->samples);
|
g_array_unref (qtpad->samples);
|
||||||
qtpad->samples = NULL;
|
qtpad->samples = NULL;
|
||||||
|
|
Loading…
Reference in a new issue