[vlc-commits] d3d11va: fix leak on error

Steve Lhomme git at videolan.org
Mon Feb 19 18:10:56 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 19 17:30:50 2018 +0100| [693a495f65f3b5ea12e3550c4b1af243d0269dd0] | committer: Steve Lhomme

d3d11va: fix leak on error

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

 modules/codec/avcodec/d3d11va.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index ac6d6bce59..0ffb06ad9c 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -420,6 +420,8 @@ 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->d3dvidctx = d3dvidctx;



More information about the vlc-commits mailing list