diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c index 12d73e488f..a58b3055c8 100644 --- a/libavformat/flac_picture.c +++ b/libavformat/flac_picture.c @@ -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) {