glbasefilter: Need to check the display before lock it.

In find_gl_context_unlocked(), the display of filter may be NULL
and can cause crash if we directly access and lock it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/922>
This commit is contained in:
He Junyan 2020-11-06 15:36:01 +08:00
parent 089a1f56b0
commit 1146a7e3a0

View file

@ -541,6 +541,11 @@ gst_gl_base_filter_find_gl_context_unlocked (GstGLBaseFilter * filter)
_find_local_gl_context_unlocked (filter);
if (!filter->display) {
GST_WARNING_OBJECT (filter, "filter has NULL display.");
return FALSE;
}
if (!filter->context) {
GST_OBJECT_LOCK (filter->display);
do {