[vlc-devel] [vlc-commits] Vorbis: do not display meaningless data in meta

Rafaël Carré funman at videolan.org
Thu Apr 5 22:50:57 CEST 2012


Le 2012-04-05 16:41, Jean-Baptiste Kempf a écrit :
> vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Apr  5 21:39:12 2012 +0200| [71a82406e23055bddbe1f9a2f3f31efd1df63938] | committer: Jean-Baptiste Kempf
> 
> Vorbis: do not display meaningless data in meta
> 
> It can even crash Qt interface

How so? Is the null terminator missing?

IIRC all vorbis comments are valid UTF8 (not sure about 0 terminate)

> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=71a82406e23055bddbe1f9a2f3f31efd1df63938
> ---
> 
>  modules/codec/vorbis.c |   15 ++++++++++-----
>  1 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/modules/codec/vorbis.c b/modules/codec/vorbis.c
> index d5a9f4b..491c7b6 100644
> --- a/modules/codec/vorbis.c
> +++ b/modules/codec/vorbis.c
> @@ -577,11 +577,6 @@ static void ParseVorbisComments( decoder_t *p_dec )
>              if( *psz_value == '\0' )
>                  break;
>  
> -            if( !p_dec->p_description )
> -                p_dec->p_description = vlc_meta_New();
> -            if( p_dec->p_description )
> -                vlc_meta_AddExtra( p_dec->p_description, psz_name, psz_value );

>              if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_GAIN" ) ||
>                       !strcasecmp( psz_name, "RG_RADIO" ) )
>              {
> @@ -613,6 +608,16 @@ static void ParseVorbisComments( decoder_t *p_dec )
>                  r->pb_peak[AUDIO_REPLAY_GAIN_ALBUM] = true;
>                  r->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = atof( psz_value );
>              }
> +            else if( !strcasecmp( psz_name, "METADATA_BLOCK_PICTURE" ) )
> +            { /* Do nothing, for now */ }

strange indentation, please add a few newlines

> +            else
> +            {
> +                if( !p_dec->p_description )
> +                    p_dec->p_description = vlc_meta_New();
> +                if( p_dec->p_description )
> +                    vlc_meta_AddExtra( p_dec->p_description, psz_name, psz_value );
> +            }
> +

What does moving this around achieve?

>          }
>          free( psz_comment );
>          i++;



More information about the vlc-devel mailing list