[vlc-commits] DirectDraw: do not save a string that is deallocated immediately after.

Felix Abecassis git at videolan.org
Mon Jan 20 16:44:38 CET 2014


vlc | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Mon Jan 20 16:30:13 2014 +0100| [fd35fe041b3e59722476f4a1e07d8c14cb4a301e] | committer: Jean-Baptiste Kempf

DirectDraw: do not save a string that is deallocated immediately after.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/msw/directx.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/msw/directx.c b/modules/video_output/msw/directx.c
index 42906f4..cb48b73 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -1424,8 +1424,8 @@ static BOOL WINAPI DirectXEnumCallback2(GUID *guid, LPTSTR desc,
     ctx->values = xrealloc(ctx->values, (ctx->count + 1) * sizeof(char *));
     ctx->descs = xrealloc(ctx->descs, (ctx->count + 1) * sizeof(char *));
 
-    ctx->values[ctx->count] = psz_drivername;
-    ctx->descs[ctx->count] = psz_drivername;
+    ctx->values[ctx->count] = strdup(psz_drivername);
+    ctx->descs[ctx->count] = strdup(psz_drivername);
     ctx->count++;
 
     free(psz_drivername);



More information about the vlc-commits mailing list