avformat/flac_picture: allocate buffer padding for picture
Fixes: heap array overread Fixes: asan_heap-oob_14876d9_4706_cov_815472558_cover_art.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
aa36dcf534
commit
fff2953163
@ -107,7 +107,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
if (!(data = av_buffer_alloc(len))) {
|
||||
if (!(data = av_buffer_alloc(len + FF_INPUT_BUFFER_PADDING_SIZE))) {
|
||||
RETURN_ERROR(AVERROR(ENOMEM));
|
||||
}
|
||||
if (avio_read(pb, data->data, len) != len) {
|
||||
|
Loading…
Reference in New Issue
Block a user