[vlc-devel] [PATCH 2/3] qt: fix uninitialized variable in dcomp compositor

Pierre Lamot pierre at videolabs.io
Wed May 20 18:20:22 CEST 2020


---
 modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp | 4 ++++
 modules/gui/qt/maininterface/compositor_dcomp_uisurface.hpp | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
index 68e7d27599..173f38bea7 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.cpp
@@ -409,9 +409,13 @@ void CompositorDCompositionUISurface::resizeSwapchain(int width, int height)
 void CompositorDCompositionUISurface::releaseSharedTexture()
 {
     if (m_eglInterimTextureQt)
+    {
         eglDestroySurface(m_eglDisplay, m_eglInterimTextureQt);
+        m_eglInterimTextureQt = 0;
+    }
     if (m_sharedTextureHandled) {
         CloseHandle(m_sharedTextureHandled);
+        m_sharedTextureHandled = nullptr;
     }
     m_d3dInterimTexture.Reset();
     m_textureShaderInput.Reset();
diff --git a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.hpp b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.hpp
index 34628ea011..299ee4c1af 100644
--- a/modules/gui/qt/maininterface/compositor_dcomp_uisurface.hpp
+++ b/modules/gui/qt/maininterface/compositor_dcomp_uisurface.hpp
@@ -145,7 +145,7 @@ private:
     //Shared texture D3D side
     Microsoft::WRL::ComPtr<ID3D11Texture2D> m_d3dInterimTexture;
     Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_textureShaderInput;
-    HANDLE m_sharedTextureHandled;
+    HANDLE m_sharedTextureHandled = nullptr;
 
     //Shared texture D3D side
     Microsoft::WRL::ComPtr<ID3D11Device> m_qtd3dDevice;
-- 
2.25.1



More information about the vlc-devel mailing list