[vlc-commits] direct3d11: fix crash on early failure

Steve Lhomme git at videolan.org
Thu Jun 11 10:00:39 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu Jun 11 09:54:10 2020 +0200| [f7baf6cb40a9462ae0cf779da64ce11d4f63f08f] | committer: Steve Lhomme

direct3d11: fix crash on early failure

Close() is called if any error occurs in Open() so it should be safe from
uninitialized fields.

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

 modules/video_output/win32/direct3d11.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index ada535e977..e302b3b521 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -979,7 +979,7 @@ static void Direct3D11Close(vout_display_t *vd)
     if ( sys->swapCb == LocalSwapchainSwap )
         LocalSwapchainCleanupDevice( sys->outside_opaque );
 
-    if (sys->d3d_dev == &sys->local_d3d_dev->d3d_dev)
+    if (sys->d3d_dev && sys->d3d_dev == &sys->local_d3d_dev->d3d_dev)
         D3D11_ReleaseDevice( sys->local_d3d_dev );
 
     msg_Dbg(vd, "Direct3D11 display adapter closed");



More information about the vlc-commits mailing list