[vlc-commits] [Git][videolan/vlc][master] qt: do not call `::destroyMainInterface()` in `CompositorDirectComposition` destructor

Steve Lhomme (@robUx4) gitlab at videolan.org
Fri Feb 7 10:30:11 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
225ba693 by Fatih Uzunoglu at 2025-02-07T09:57:55+00:00
qt: do not call `::destroyMainInterface()` in `CompositorDirectComposition` destructor

When `::destroyMainInterface()` already gets called before, `::unloadGUI()` gets
called again as well and with the recent introduction of `m_quickView->setSource(QUrl());`
there without first checking for null pointer it causes null pointer dereference as
`::destroyMainInterface()` already destroys the `::m_quickView` instance.

At the same time, calling `::destroyMainInterface()` during destruction causes
the same null pointer dereference, since if initialization fails there is no
`::m_quickView` instance. This is a case with Windows 7 where direct composition
is not available, which causes crash at start.

- - - - -


1 changed file:

- modules/gui/qt/maininterface/compositor_dcomp.cpp


Changes:

=====================================
modules/gui/qt/maininterface/compositor_dcomp.cpp
=====================================
@@ -102,7 +102,6 @@ CompositorDirectComposition::~CompositorDirectComposition()
 {
     //m_acrylicSurface should be released before the RHI context is destroyed
     assert(!m_acrylicSurface);
-    destroyMainInterface();
 }
 
 bool CompositorDirectComposition::init()
@@ -352,7 +351,8 @@ void CompositorDirectComposition::unloadGUI()
     //be valid as it may still be used by the vout window.
     //we cant' just delete the qmlEngine as the QmlView as the root item is parented to the QmlView
     //setSource() to nothing will effectively destroy the root item
-    m_quickView->setSource(QUrl());
+    if (Q_LIKELY(m_quickView))
+        m_quickView->setSource(QUrl());
 
     commonGUIDestroy();
 }



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/225ba6933afe5c624babc4391eb72ed98dc227be

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/225ba6933afe5c624babc4391eb72ed98dc227be
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list