[vlc-commits] d3d11va: fix leak on error

Steve Lhomme git at videolan.org
Tue Feb 20 10:03:24 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Feb 19 17:30:50 2018 +0100| [d91845a5c226fa9e46f192b4ad2c8f0c9db777a5] | committer: Hugo Beauzée-Luyssen

d3d11va: fix leak on error

(cherry picked from commit 693a495f65f3b5ea12e3550c4b1af243d0269dd0)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

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

 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