[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: fix null dereferencing in X11 compositor
Steve Lhomme (@robUx4)
gitlab at videolan.org
Thu Jul 13 12:19:41 UTC 2023
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
0a141261 by Pierre Lamot at 2023-07-13T12:04:59+00:00
qt: fix null dereferencing in X11 compositor
this may happen when the interface is shutting down (render stopped but video
still runing)
- - - - -
3110c739 by Pierre Lamot at 2023-07-13T12:04:59+00:00
qt: ensure QAccessibleRenderWindow validity
If the underlying windows is or becomes null, mark the accessible interface as
invalid
- - - - -
2 changed files:
- modules/gui/qt/maininterface/compositor_accessibility.cpp
- modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
Changes:
=====================================
modules/gui/qt/maininterface/compositor_accessibility.cpp
=====================================
@@ -74,6 +74,13 @@ public:
{
}
+ bool isValid() const override
+ {
+ if (m_window.isNull())
+ return false;
+ return QAccessibleObject::isValid();
+ }
+
QAccessibleInterface* parent() const override
{
// we assume to be a top level window...
@@ -82,12 +89,13 @@ public:
QList<QQuickItem *> rootItems() const
{
+ if (m_window.isNull())
+ return {};
if (QQuickItem *ci = m_window->contentItem())
return accessibleUnignoredChildren(ci);
- return QList<QQuickItem *>();
+ return {};
}
-
QAccessibleInterface* child(int index) const override
{
const QList<QQuickItem*> &kids = rootItems();
@@ -166,7 +174,8 @@ public:
}
private:
- QQuickWindow* m_window;
+ //use a QPointer here in case the underlying window get destroyed
+ QPointer<QQuickWindow> m_window;
};
=====================================
modules/gui/qt/maininterface/compositor_x11_renderwindow.cpp
=====================================
@@ -514,6 +514,8 @@ void CompositorX11RenderWindow::disableVideoWindow()
QQuickWindow* CompositorX11RenderWindow::getOffscreenWindow() const
{
+ if (!m_interfaceWindow)
+ return nullptr;
return m_interfaceWindow->getOffscreenWindow();
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c901da645b3a00766831750fe882b8a52360ef88...3110c739da90e430f8c6f5ba1d2ead229f324d5f
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c901da645b3a00766831750fe882b8a52360ef88...3110c739da90e430f8c6f5ba1d2ead229f324d5f
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