[vlc-commits] direct3d11: avoid a potential crash

2018-02-13 Thread Steve Lhomme
vlc/vlc-3.0 | branch: master | Steve Lhomme  | 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 

> 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


[vlc-commits] direct3d11: avoid a potential crash

2018-02-12 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Mon Feb 12 15:21:11 
2018 +0100| [e407cf0fd40e7aed0a58d49b27773409a0455834] | committer: Steve Lhomme

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

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

 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 48e261cc07..57d68ba9d5 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2552,6 +2552,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