projects
/
platform
/
upstream
/
gstreamer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f6e2dee
)
bufferlist: fix buffer leak in _remove()
author
Tim-Philipp Müller
<tim@centricular.com>
Mon, 16 Jun 2014 19:29:56 +0000
(20:29 +0100)
committer
Tim-Philipp Müller
<tim@centricular.com>
Mon, 16 Jun 2014 19:29:56 +0000
(20:29 +0100)
gst/gstbufferlist.c
patch
|
blob
|
history
diff --git
a/gst/gstbufferlist.c
b/gst/gstbufferlist.c
index
5f743a1
..
dca866c
100644
(file)
--- a/
gst/gstbufferlist.c
+++ b/
gst/gstbufferlist.c
@@
-281,14
+281,21
@@
gst_buffer_list_insert (GstBufferList * list, gint idx, GstBuffer * buffer)
* @idx: the index
* @length: the amount to remove
*
* @idx: the index
* @length: the amount to remove
*
- * Remove @length buffers starting from @idx in @list. The following buffers
are
- * moved to close the gap.
+ * Remove @length buffers starting from @idx in @list. The following buffers
+ *
are
moved to close the gap.
*/
void
gst_buffer_list_remove (GstBufferList * list, guint idx, guint length)
{
*/
void
gst_buffer_list_remove (GstBufferList * list, guint idx, guint length)
{
+ GstBuffer *buf;
+ gint i;
+
g_return_if_fail (GST_IS_BUFFER_LIST (list));
g_return_if_fail (idx < list->array->len);
g_return_if_fail (GST_IS_BUFFER_LIST (list));
g_return_if_fail (idx < list->array->len);
+ for (i = idx; i < idx + length; ++i) {
+ buf = g_array_index (list->array, GstBuffer *, i);
+ gst_buffer_unref (buf);
+ }
g_array_remove_range (list->array, idx, length);
}
g_array_remove_range (list->array, idx, length);
}