[vlc-commits] d3d11_quad: fix potential leak

Steve Lhomme git at videolan.org
Tue Jun 5 13:20:28 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jun  5 11:18:39 2018 +0200| [87b4750d6fefc562dd31c140755c51962a47c9ee] | committer: Steve Lhomme

d3d11_quad: fix potential leak

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

 modules/video_output/win32/d3d11_quad.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/win32/d3d11_quad.c b/modules/video_output/win32/d3d11_quad.c
index b1bea62485..708d7cd685 100644
--- a/modules/video_output/win32/d3d11_quad.c
+++ b/modules/video_output/win32/d3d11_quad.c
@@ -551,6 +551,7 @@ static void SetupQuadCube(d3d_vertex_t *dst_data, const RECT *output,
 bool D3D11_UpdateQuadPosition( vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad,
                                 const RECT *output, video_orientation_t orientation )
 {
+    bool result = true;
     HRESULT hr;
     D3D11_MAPPED_SUBRESOURCE mappedResource;
 
@@ -587,13 +588,13 @@ bool D3D11_UpdateQuadPosition( vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_qua
         break;
     default:
         msg_Warn(o, "Projection mode %d not handled", quad->projection);
-        return false;
+        result = false;
     }
 
     ID3D11DeviceContext_Unmap(d3d_dev->d3dcontext, (ID3D11Resource *)quad->pIndexBuffer, 0);
     ID3D11DeviceContext_Unmap(d3d_dev->d3dcontext, (ID3D11Resource *)quad->pVertexBuffer, 0);
 
-    return true;
+    return result;
 }
 
 static bool ShaderUpdateConstants(vlc_object_t *o, d3d11_device_t *d3d_dev, d3d_quad_t *quad, size_t index, void *new_buf)



More information about the vlc-commits mailing list