[vlc-devel] commit: Ensure that meta-* are valid UTF8. (Laurent Aimar )

Rémi Denis-Courmont rem at videolan.org
Mon Mar 23 03:32:01 CET 2009


Le Sunday 22 March 2009 17:34:04 git version control, vous avez écrit :
> diff --git a/src/input/input.c b/src/input/input.c
> index 94b1d76..f5b78a7 100644
> --- a/src/input/input.c
> +++ b/src/input/input.c
> @@ -2773,8 +2773,10 @@ static void InputMetaUser( input_thread_t *p_input,
> vlc_meta_t *p_meta ) /* Get meta information from user */
>  #define GET_META( field, s ) do { \
>      char *psz_string = var_GetNonEmptyString( p_input, (s) );  \
> -    if( psz_string ) \
> +    if( psz_string ) {\
> +        EnsureUTF8( psz_string ); \
>          vlc_meta_Set( p_meta, vlc_meta_ ## field, psz_string ); \
> +    } \
>      free( psz_string ); } while(0)

BTW IMHO free() should be inside the if() statement here (as we need the if() 
anyway).

(N.B.: I am away from my SSH key for a week)

-- 
Rémi Denis-Courmont



More information about the vlc-devel mailing list