[vlc-commits] direct3d11: avoid a potential crash

Steve Lhomme git at videolan.org
Tue Feb 13 11:38:22 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 12 15:21:11 2018 +0100| [4556ff4a4a754f0e546b97706b6af1c660e36e75] | committer: Hugo Beauzée-Luyssen

direct3d11: avoid a potential crash

It should not happen but it seems that Manage could be called when the resources
have been destroyed.

Ref 4d56256c-20a1-4238-8c2a-f9c80b579900

(cherry picked from commit e407cf0fd40e7aed0a58d49b27773409a0455834)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

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

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index 324c968bcd..6ca4a3a2be 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2582,6 +2582,9 @@ static bool UpdateQuadPosition( vout_display_t *vd, d3d_quad_t *quad,
     HRESULT hr;
     D3D11_MAPPED_SUBRESOURCE mappedResource;
 
+    if (unlikely(quad->pVertexBuffer == NULL))
+        return false;
+
     /* create the vertices */
     hr = ID3D11DeviceContext_Map(sys->d3d_dev.d3dcontext, (ID3D11Resource *)quad->pVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
     if (FAILED(hr)) {



More information about the vlc-commits mailing list