[vlc-devel] [PATCH 35/36] d3d11va: don't release the d3d_dev interfaces when failing to query others

Steve Lhomme robux4 at ycbcr.xyz
Thu Nov 21 15:14:26 CET 2019


---
 modules/codec/avcodec/d3d11va.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 974033600f8..27b12ed331a 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -388,8 +388,6 @@ static int D3dCreateDevice(vlc_va_t *va)
     hr = ID3D11DeviceContext_QueryInterface(sys->d3d_dev.d3dcontext, &IID_ID3D11VideoContext, &d3dvidctx);
     if (FAILED(hr)) {
        msg_Err(va, "Could not Query ID3D11VideoContext Interface. (hr=0x%lX)", hr);
-       ID3D11DeviceContext_Release(sys->d3d_dev.d3dcontext);
-       ID3D11Device_Release(sys->d3d_dev.d3ddevice);
        return VLC_EGENERIC;
     }
     sys->hw.video_context = d3dvidctx;
@@ -398,8 +396,6 @@ static int D3dCreateDevice(vlc_va_t *va)
     hr = ID3D11Device_QueryInterface(sys->d3d_dev.d3ddevice, &IID_ID3D11VideoDevice, &d3dviddev);
     if (FAILED(hr)) {
        msg_Err(va, "Could not Query ID3D11VideoDevice Interface. (hr=0x%lX)", hr);
-       ID3D11DeviceContext_Release(sys->d3d_dev.d3dcontext);
-       ID3D11Device_Release(sys->d3d_dev.d3ddevice);
        ID3D11VideoContext_Release(sys->hw.video_context);
        return VLC_EGENERIC;
     }
-- 
2.17.1



More information about the vlc-devel mailing list