[FFmpeg-cvslog] lavf: deprecate get_strz() in favor of avio_get_str

Reimar Döffinger Reimar.Doeffinger
Sat Mar 5 12:42:30 CET 2011


On Sat, Mar 05, 2011 at 03:28:22AM +0100, Anton Khirnov wrote:
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 537b9c6..ad5bada 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -2331,7 +2331,7 @@ static void mov_read_chapters(AVFormatContext *s)
>              avio_get_str16le(sc->pb, len, title, title_len);
>          else {
>              AV_WB16(title, ch);
> -            get_strz(sc->pb, title + 2, len - 1);
> +            avio_get_str(sc->pb, len - 2, title + 2, title_len - 2);

This is now completely confusing.
Just doing
if (len >= 2)
    avio_read(sc->pb, title + 2, len - 2);
title[len] = 0;
would be more readable and also fix an integer overflow bug,
which as far as I can tell can lead to a buffer overflow.



More information about the ffmpeg-cvslog mailing list