Commit 24cfe91a authored by Michael Niedermayer's avatar Michael Niedermayer

id3v2: allocate large enough buffer

Fixes array overread

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent aa28c425
...@@ -489,7 +489,8 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag ...@@ -489,7 +489,8 @@ static void read_apic(AVFormatContext *s, AVIOContext *pb, int taglen, char *tag
goto fail; goto fail;
} }
apic->buf = av_buffer_alloc(taglen); apic->buf = av_buffer_alloc(taglen + FF_INPUT_BUFFER_PADDING_SIZE);
apic->buf->size -= FF_INPUT_BUFFER_PADDING_SIZE;
if (!apic->buf || !taglen || avio_read(pb, apic->buf->data, taglen) != taglen) if (!apic->buf || !taglen || avio_read(pb, apic->buf->data, taglen) != taglen)
goto fail; goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment