From 1146a7e3a0f74bf92b5d55e82c827d9862c29fdd Mon Sep 17 00:00:00 2001 From: He Junyan Date: Fri, 6 Nov 2020 15:36:01 +0800 Subject: [PATCH] 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: --- gst-libs/gst/gl/gstglbasefilter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst-libs/gst/gl/gstglbasefilter.c b/gst-libs/gst/gl/gstglbasefilter.c index 86710733a4..40f37e1f81 100644 --- a/gst-libs/gst/gl/gstglbasefilter.c +++ b/gst-libs/gst/gl/gstglbasefilter.c @@ -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 {