Now the OpenGL context is deactivated if call to gst_gl_context_fill_info()
fails in gst_qt_get_gl_wrapcontext(), preventing that the context is left
activated, which could lead to invalid memory reads.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3492>
gst_gl_context_activate(*wrap_glcontext, TRUE);
if (!gst_gl_context_fill_info (*wrap_glcontext, &error)) {
GST_ERROR ("failed to retrieve qt context info: %s", error->message);
+ gst_gl_context_activate(*wrap_glcontext, FALSE);
gst_clear_object (wrap_glcontext);
return FALSE;
}
gst_gl_context_activate(*wrap_glcontext, TRUE);
if (!gst_gl_context_fill_info (*wrap_glcontext, &error)) {
GST_ERROR ("failed to retrieve qt context info: %s", error->message);
+ gst_gl_context_activate(*wrap_glcontext, FALSE);
gst_clear_object (wrap_glcontext);
return FALSE;
}