vlc | branch: master | Steve Lhomme <rob...@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;
     }
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to