vlc/vlc-3.0 | branch: master | Steve Lhomme <rob...@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 <h...@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)) {

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to