diff options
author | Bo Elmgreen <bo.elmgreen@gmail.com> | 2022-11-30 14:32:52 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2022-12-01 14:21:37 +0000 |
commit | 1f88f411bce08dc1df820681aee8dba3cd132c24 (patch) | |
tree | 952c517201456d63f3a3b298314174639db0a23b | |
parent | 925715c734d5f9d594468c38dd19672e23e9e69b (diff) | |
download | gstreamer-1f88f411bce08dc1df820681aee8dba3cd132c24.tar.gz |
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>
-rw-r--r-- | subprojects/gst-plugins-good/ext/qt/gstqtglutility.cc | 1 | ||||
-rw-r--r-- | subprojects/gst-plugins-good/ext/qt6/gstqt6glutility.cc | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-good/ext/qt/gstqtglutility.cc b/subprojects/gst-plugins-good/ext/qt/gstqtglutility.cc index ad04f14b17..84d5618967 100644 --- a/subprojects/gst-plugins-good/ext/qt/gstqtglutility.cc +++ b/subprojects/gst-plugins-good/ext/qt/gstqtglutility.cc @@ -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; } diff --git a/subprojects/gst-plugins-good/ext/qt6/gstqt6glutility.cc b/subprojects/gst-plugins-good/ext/qt6/gstqt6glutility.cc index ae219040b6..11daec37f8 100644 --- a/subprojects/gst-plugins-good/ext/qt6/gstqt6glutility.cc +++ b/subprojects/gst-plugins-good/ext/qt6/gstqt6glutility.cc @@ -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; } |