uridecodebin3: Nullify current item after all play items are freed.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 16 Nov 2021 12:14:25 +0000 (13:14 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 16 Nov 2021 12:25:02 +0000 (13:25 +0100)
commit6d7dc93a450d50053bbc1c7ab67fc300f7ccdf1a
tree15c850545fba6e84be6c1e19b6d88a87b02a8008
parent372970413213d61cbe24a4e70301d114fbbd7c6b
uridecodebin3: Nullify current item after all play items are freed.

There's a potential race condition with this sort of pipelines on
certain systems (depends on the processing load):

GST_DEBUG_DUMP_DOT_DIR=/tmp \
gst-launch-1.0 uridecodebin3 uri=file://stream.mp4 ! glupload ! \
glimagesink --gst-debug=*:4

Right after the pipeline passes from PAUSED to READY, bin_to_dot_file
dumps uridecodebin3 properties, but current uri and suburi might be
already freed, causing a potential use-after-freed.

This patch makes NULL the current item right after all the play items
are freed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1353>
subprojects/gst-plugins-base/gst/playback/gsturidecodebin3.c