aggregator: Release pads' peeked buffer when removing the pad or finalizing it
authorSebastian Dröge <sebastian@centricular.com>
Tue, 6 Apr 2021 17:56:55 +0000 (20:56 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 6 Apr 2021 18:17:56 +0000 (21:17 +0300)
commitdefe732ae0ccc61cfb2f98f0768bba459dbf08af
tree032a6e67461c1b5718045b79aabd1a73dc82ca9c
parent96b10c158fc7429ddeae11207c9a3cead3504d19
aggregator: Release pads' peeked buffer when removing the pad or finalizing it

The peeked buffer was always reset after calling ::aggregate() but under
no other circumstances. If a pad was removed after peeking and before
::aggregate() returned then the peeked buffer would be leaked.

This can easily happen if pads are removed from the aggregator from a
pad probe downstream of the source pad but still in the source pad's
streaming thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/784>
libs/gst/base/gstaggregator.c
tests/check/libs/aggregator.c