mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
qt: deactivate context if fill_info fails
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>
This commit is contained in:
parent
925715c734
commit
1f88f411bc
2 changed files with 2 additions and 0 deletions
|
@ -248,6 +248,7 @@ gst_qt_get_gl_wrapcontext (GstGLDisplay * display,
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -246,6 +246,7 @@ gst_qml6_get_gl_wrapcontext (GstGLDisplay * display,
|
|||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue