[vlc-commits] Direct3D: fix memory leak

Hannes Domani git at videolan.org
Sat Aug 30 02:40:45 CEST 2014


vlc/vlc-2.2 | branch: master | Hannes Domani <ssbssa at yahoo.de> | Thu Aug 28 14:13:03 2014 +0200| [7614ae5378aeccfd391ab3309d1b05c4bc22290f] | committer: Jean-Baptiste Kempf

Direct3D: fix memory leak

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
(cherry picked from commit 9ac30b31fc91e5a47135c1ca2f9c08ea0f5c255d)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/msw/direct3d.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index fc959fc..4b62a56 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -511,11 +511,9 @@ static HINSTANCE Direct3DLoadShaderLibrary(void)
 {
     HINSTANCE instance = NULL;
     for (int i = 43; i > 23; --i) {
-        char *filename = NULL;
-        if (asprintf(&filename, "D3dx9_%d.dll", i) == -1)
-            continue;
-        instance = LoadLibrary(ToT(filename));
-        free(filename);
+        TCHAR filename[16];
+        _sntprintf(filename, 16, TEXT("D3dx9_%d.dll"), i);
+        instance = LoadLibrary(filename);
         if (instance)
             break;
     }



More information about the vlc-commits mailing list