Commit edc8b8e6 authored by Laurent Aimar's avatar Laurent Aimar

Fixed sanetizing of file name in input_CreateFilename.

It should fix #2620 (and was not limited to windows only).
parent e99754a7
...@@ -3253,13 +3253,16 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha ...@@ -3253,13 +3253,16 @@ char *input_CreateFilename( vlc_object_t *p_obj, const char *psz_path, const cha
if( !psz_tmp ) if( !psz_tmp )
return NULL; return NULL;
filename_sanitize( psz_tmp ); char *psz_tmp2 = filename_sanitize( psz_tmp );
if( asprintf( &psz_file, "%s"DIR_SEP"%s%s%s", free( psz_tmp );
psz_path, psz_tmp,
if( !psz_tmp2 ||
asprintf( &psz_file, "%s"DIR_SEP"%s%s%s",
psz_path, psz_tmp2,
psz_extension ? "." : "", psz_extension ? "." : "",
psz_extension ? psz_extension : "" ) < 0 ) psz_extension ? psz_extension : "" ) < 0 )
psz_file = NULL; psz_file = NULL;
free( psz_tmp ); free( psz_tmp2 );
return psz_file; return psz_file;
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment