[vlc-commits] Direct3D: fix memory leak
Hannes Domani
git at videolan.org
Thu Aug 28 21:48:10 CEST 2014
vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Thu Aug 28 14:13:03 2014 +0200| [9ac30b31fc91e5a47135c1ca2f9c08ea0f5c255d] | committer: Rémi Denis-Courmont
Direct3D: fix memory leak
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ac30b31fc91e5a47135c1ca2f9c08ea0f5c255d
---
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 1d7c7c8..7fa4585 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -512,11 +512,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