[vlc-commits] direct3d11: fix crash when Direct3D11DestroyResources() is called twice

Steve Lhomme git at videolan.org
Mon Jun 20 17:06:04 CEST 2016


vlc | branch: master | Steve Lhomme <robux4 at gmail.com> | Mon Jun 20 17:04:25 2016 +0200| [b104c22b1039a111c3a52cb4d3582afbb317e333] | committer: Jean-Baptiste Kempf

direct3d11: fix crash when Direct3D11DestroyResources() is called twice

this happens is some cases where Open() fails

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b104c22b1039a111c3a52cb4d3582afbb317e333
---

 modules/video_output/win32/direct3d11.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 987cb2a..37a04fb 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -1633,15 +1633,25 @@ static void Direct3D11DestroyResources(vout_display_t *vd)
     sys->d3dregion_count = 0;
 
     if (sys->d3drenderTargetView)
+    {
         ID3D11RenderTargetView_Release(sys->d3drenderTargetView);
+        sys->d3drenderTargetView = NULL;
+    }
     if (sys->d3ddepthStencilView)
+    {
         ID3D11DepthStencilView_Release(sys->d3ddepthStencilView);
+        sys->d3ddepthStencilView = NULL;
+    }
     if (sys->pSPUPixelShader)
+    {
         ID3D11VertexShader_Release(sys->pSPUPixelShader);
+        sys->pSPUPixelShader = NULL;
+    }
 #if defined(HAVE_ID3D11VIDEODECODER) && VLC_WINSTORE_APP
     if( sys->context_lock > 0 )
     {
         CloseHandle( sys->context_lock );
+        sys->context_lock = INVALID_HANDLE_VALUE;
     }
 #endif
 



More information about the vlc-commits mailing list