compositor: Don't crash in prepare_frame() if the pad was just removed

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/950>
This commit is contained in:
Sebastian Dröge 2020-12-01 13:13:40 +02:00
parent 3ab2023ed8
commit 831199a808

View file

@ -433,7 +433,10 @@ gst_compositor_pad_prepare_frame (GstVideoAggregatorPad * pad,
/* Check if this frame is obscured by a higher-zorder frame
* TODO: Also skip a frame if it's obscured by a combination of
* higher-zorder frames */
l = g_list_find (GST_ELEMENT (vagg)->sinkpads, pad)->next;
l = g_list_find (GST_ELEMENT (vagg)->sinkpads, pad);
/* The pad might've just been removed */
if (l)
l = l->next;
for (; l; l = l->next) {
if (_pad_obscures_rectangle (vagg, l->data, frame_rect)) {
frame_obscured = TRUE;