gluploadelement: Avoid race condition of inside upload creation.
authorHe Junyan <junyan.he@intel.com>
Tue, 3 Nov 2020 12:19:16 +0000 (20:19 +0800)
committerHe Junyan <junyan.he@intel.com>
Wed, 4 Nov 2020 05:55:07 +0000 (13:55 +0800)
commit9e37fa55bf223a42f50f0c495fcbe01a5532dee3
tree1e6f6d52f317421924cffe6d6f59bfc4fb873bd4
parent576f950e18bd3635f989590b4e881b9f255318a6
gluploadelement: Avoid race condition of inside upload creation.

The operations for the inside GstGLUploadElement->upload have race
condition. The _transform_caps() will creates this object if it does
not exist, while the _stop() and change_state() can destroy this object.
The _transform_caps() is called by the gst_base_transform_query(),
so it does not hold the stream lock. It may use the upload while the
_stop() and change_state() has already destroy that object, and then
crash.

Fix: #645
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/913>
ext/gl/gstgluploadelement.c