vlc/vlc-3.0 | branch: master | Steve Lhomme <[email protected]> | Wed Mar 21 09:56:35 2018 +0100| [a1fca1187092e13631a502533d822d401b09d557] | committer: Hugo Beauzée-Luyssen
direct3d11: check the pointers before mapping the texture And use the proper slice, even though it's currently always 0 Ref #20103 (cherry picked from commit 72375dd63c2fcde4409aa00ff9fedf6fc60c9852) Signed-off-by: Hugo Beauzée-Luyssen <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=a1fca1187092e13631a502533d822d401b09d557 --- modules/video_output/win32/direct3d11.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c index 2e62f22b64..843b771475 100644 --- a/modules/video_output/win32/direct3d11.c +++ b/modules/video_output/win32/direct3d11.c @@ -399,7 +399,19 @@ static int Direct3D11MapPoolTexture(picture_t *picture) picture_sys_t *p_sys = picture->p_sys; D3D11_MAPPED_SUBRESOURCE mappedResource; HRESULT hr; - hr = ID3D11DeviceContext_Map(p_sys->context, p_sys->resource[KNOWN_DXGI_INDEX], 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); + + ID3D11Device *dev; + ID3D11DeviceContext_GetDevice(p_sys->context, &dev); + ID3D11Device_Release(dev); + +#ifndef NDEBUG + D3D11_TEXTURE2D_DESC dsc; + ID3D11Texture2D_GetDesc(p_sys->texture[KNOWN_DXGI_INDEX], &dsc); + assert(dsc.CPUAccessFlags & D3D11_CPU_ACCESS_WRITE); + assert(dsc.Usage & D3D11_USAGE_DYNAMIC); +#endif + + hr = ID3D11DeviceContext_Map(p_sys->context, p_sys->resource[KNOWN_DXGI_INDEX], p_sys->slice_index, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); if( FAILED(hr) ) { return VLC_EGENERIC; _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
