summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2017-10-06 21:59:03 +0200
committerMathieu Duponchelle <mathieu@centricular.com>2017-10-11 19:57:04 +0200
commite838007d096cefd0f500cde86a4ca550930ca40b (patch)
treeb03324d9fbd43e97d89055ca9c9166e12c15d158 /gst
parent6617b01af92b72f5ee348be111bf3a2bb2288ea1 (diff)
gstbuffer: fix meta removal in gst_buffer_foreach_meta
When updating the linked list, prev->next = next is correct if prev is actually updated after being set to the head of the list at the start. https://bugzilla.gnome.org/show_bug.cgi?id=788617
Diffstat (limited to 'gst')
-rw-r--r--gst/gstbuffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c
index 307754389..34ca5171f 100644
--- a/gst/gstbuffer.c
+++ b/gst/gstbuffer.c
@@ -2370,12 +2370,16 @@ gst_buffer_foreach_meta (GstBuffer * buffer, GstBufferForeachMetaFunc func,
else
prev->next = next;
+ prev = next;
+
/* call free_func if any */
if (info->free_func)
info->free_func (m, buffer);
/* and free the slice */
g_slice_free1 (ITEM_SIZE (info), walk);
+ } else {
+ prev = walk;
}
if (!res)
break;