appsink callback race condition
Submitted by Jake Foytik
Link to original bug (#769394)
Description
In gstappsink.c, it is possible to get undefined behavior if the gst_app_sink_set_callbacks() function is called while the element is in the PLAYING state and actively using the already set callbacks.
For example, it is possible for the gst_app_sink_set_callbacks() function to set callbacks.new_sample = NULL just after the gst_app_sink_render() function checks if callback.new_sample == NULL.
This can be prevented by adding a mutex around the usage of the callbacks and around the gst_app_sink_set_callbacks() function. Another option is to not allow the callbacks to be set if the element is in the PLAYING state.
Version: 1.8.0