buffer: Fix memory corruption in gst_buffer_foreach_meta() when removing metas
authorDardo D Kleiner <dardokleiner@gmail.com>
Sat, 1 Dec 2018 15:48:11 +0000 (10:48 -0500)
committerSebastian Dröge <slomo@coaxion.net>
Wed, 5 Dec 2018 20:50:45 +0000 (20:50 +0000)
commit6318e7c6750470b0d1378d6550715668c0747758
treedb74d39c252f890a226c4432bdfa46d0e49bbe48
parent5ba35957630c95f9307f3f0dd0dc34946b8fe447
buffer: Fix memory corruption in gst_buffer_foreach_meta() when removing metas

Fix corruption of meta list head when removing metas at the beginning
during iteration. Linked list handling in gst_buffer_foreach_meta
failed to track the previous entry and update the correct next pointer
when removing items from beyond the head of the list, resulting in
arbitrary list pointer corruption.

Closes #332
gst/gstbuffer.c