[FFmpeg-devel] [PATCH] lavf/id3v2: fail read_apic on EOF reading mimetype

Tomas Härdin tjoppen at acc.umu.se
Fri Dec 14 13:27:58 EET 2018


tor 2018-12-13 klockan 11:28 -0800 skrev chcunningham:
> avio_read may return EOF, leaving the mimetype array unitialized. fail
> early when this occurs to avoid using the array in an unitialized state.
> ---
>  libavformat/id3v2.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
> index f7de26a1d8..f06b9a787e 100644
> --- a/libavformat/id3v2.c
> +++ b/libavformat/id3v2.c
> @@ -609,10 +609,13 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen,
>      taglen--;
>  
>      /* mimetype */
> +    memset(mimetype, 0, sizeof(mimetype));

-char mimetype[64];
+char mimetype[64] = {0};

would be enough

/Tomas


More information about the ffmpeg-devel mailing list