[vlc-commits] d3d11va: Fix memory leak on error
Hugo Beauzée-Luyssen
git at videolan.org
Thu Aug 9 10:13:24 CEST 2018
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Aug 9 09:57:56 2018 +0200| [d88ee7f07c47d1e71797391b0e50c330cd90a4af] | committer: Hugo Beauzée-Luyssen
d3d11va: Fix memory leak on error
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d88ee7f07c47d1e71797391b0e50c330cd90a4af
---
modules/codec/avcodec/d3d11va.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 1d6a8f5cc4..dde2e75596 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -586,10 +586,13 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
if (FAILED(hr))
return VLC_EGENERIC;
+ char *psz_decoder_name = directx_va_GetDecoderName(input);
+
if (!directx_va_canUseDecoder(va, adapterDesc.VendorId, adapterDesc.DeviceId,
input, sys->d3d_dev.WDDM.build))
{
- msg_Warn(va, "GPU blacklisted for %s codec", directx_va_GetDecoderName(input));
+ msg_Warn(va, "GPU blacklisted for %s codec", psz_decoder_name);
+ free(psz_decoder_name);
return VLC_EGENERIC;
}
@@ -603,8 +606,6 @@ static int DxSetupOutput(vlc_va_t *va, const GUID *input, const video_format_t *
processorInput[idx++] = DXGI_FORMAT_420_OPAQUE;
processorInput[idx++] = DXGI_FORMAT_UNKNOWN;
- char *psz_decoder_name = directx_va_GetDecoderName(input);
-
/* */
for (idx = 0; processorInput[idx] != DXGI_FORMAT_UNKNOWN; ++idx)
{
More information about the vlc-commits
mailing list