[FFmpeg-devel] [PATCH] mp3enc: fix ISO-8859-1 range

Baptiste Coudurier baptiste.coudurier
Sun Feb 6 23:22:20 CET 2011


On 02/06/2011 01:47 PM, Anton Khirnov wrote:
> It starts on 32, not 1.
>
> Thanks to Arpi for spotting this.
> ---
>   libavformat/mp3enc.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c
> index 5921ded..d043296 100644
> --- a/libavformat/mp3enc.c
> +++ b/libavformat/mp3enc.c
> @@ -79,7 +79,7 @@ static void id3v2_put_size(AVFormatContext *s, int size)
>
>   static int string_is_ascii(const uint8_t *str)
>   {
> -    while (*str&&  *str<  128) str++;
> +    while (*str&&  *str>= 32 *str<  128) str++;
>       return !*str;

Duh, newline (\n) is ascii and can be coded as such, think about lyrics.

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list