[vlc-commits] direct3d11: fix a potential leak on error

Steve Lhomme git at videolan.org
Tue Feb 13 11:38:32 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb  9 14:17:20 2018 +0100| [ea90f898f3622ce868bc6e56992d772f313fdfe1] | committer: Hugo Beauzée-Luyssen

direct3d11: fix a potential leak on error

For now it shouldn't leak as on error we release the whole quad anyway.

(cherry picked from commit eb6af3c36d674d55a3f37992545f70f953e2ce45)
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=ea90f898f3622ce868bc6e56992d772f313fdfe1
---

 modules/video_output/win32/direct3d11.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_output/win32/direct3d11.c b/modules/video_output/win32/direct3d11.c
index c1841156f5..3f21572f8e 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2552,6 +2552,8 @@ static bool AllocQuadVertices(vout_display_t *vd, d3d_quad_t *quad,
     hr = ID3D11Device_CreateBuffer(sys->d3d_dev.d3ddevice, &quadDesc, NULL, &quad->pIndexBuffer);
     if(FAILED(hr)) {
         msg_Err(vd, "Could not create the quad indices. (hr=0x%lX)", hr);
+        ID3D11Buffer_Release(quad->pVertexBuffer);
+        quad->pVertexBuffer = NULL;
         return false;
     }
 



More information about the vlc-commits mailing list