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

Steve Lhomme git at videolan.org
Fri Feb 9 16:49:54 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb  9 14:17:20 2018 +0100| [eb6af3c36d674d55a3f37992545f70f953e2ce45] | committer: Steve Lhomme

direct3d11: fix a potential leak on error

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

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

 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 ccd2da22af..2da65f44c9 100644
--- a/modules/video_output/win32/direct3d11.c
+++ b/modules/video_output/win32/direct3d11.c
@@ -2550,6 +2550,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