vlc | branch: master | Jean-Baptiste Kempf <j...@videolan.org> | Mon Sep 24 
15:30:34 2012 +0200| [fe6e7e3d43238b85c9c2f2379410a5ea1c5c8247] | committer: 
Jean-Baptiste Kempf

Record: escape file names

Close #7490

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

 modules/stream_out/record.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/modules/stream_out/record.c b/modules/stream_out/record.c
index 99fac51..c1cbf42 100644
--- a/modules/stream_out/record.c
+++ b/modules/stream_out/record.c
@@ -312,17 +312,24 @@ static int OutputNew( sout_stream_t *p_stream,
                       const char *psz_muxer, const char *psz_prefix, const 
char *psz_extension  )
 {
     sout_stream_sys_t *p_sys = p_stream->p_sys;
-    char *psz_file = NULL;
+    char *psz_file = NULL, *psz_tmp = NULL;
     char *psz_output = NULL;
     int i_count;
 
-    if( asprintf( &psz_file, "%s%s%s",
+    if( asprintf( &psz_tmp, "%s%s%s",
                   psz_prefix, psz_extension ? "." : "", psz_extension ? 
psz_extension : "" ) < 0 )
     {
-        psz_file = NULL;
         goto error;
     }
 
+    psz_file = config_StringEscape( psz_tmp );
+    if( !psz_file )
+    {
+        free( psz_tmp );
+        goto error;
+    }
+    free( psz_tmp );
+
     if( asprintf( &psz_output, "std{access=file,mux='%s',dst='%s'}",
                   psz_muxer, psz_file ) < 0 )
     {

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

Reply via email to