splitmuxsrc: Stop pad task before cleanup
authorJan Schmidt <jan@centricular.com>
Tue, 16 Aug 2022 23:11:52 +0000 (09:11 +1000)
committerJan Schmidt <jan@centricular.com>
Tue, 16 Aug 2022 23:42:50 +0000 (09:42 +1000)
commit4a6c2e67201c36101b52a43b4cc21d203bbce07d
treeab200b8812eafa01b74e97e97aa6a89144f58e68
parentc2fa0b50ce66b95ef552864ca2a00638c523ddc8
splitmuxsrc: Stop pad task before cleanup

When stopping the element, make sure the pad task
is stopped before destroying the part readers.

Closes a race where the pad task might access
a freed pointer.

Also add a guard against this sort of thing
by holding a ref to the reader in the pad loop.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2901>
subprojects/gst-plugins-good/gst/multifile/gstsplitmuxsrc.c