aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-31 17:31:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-23 14:43:18 +0100
commite266fcf0834a76c747483df408b23d5b9bb991e0 (patch)
treef11cee0cae26d7f5983e0811d1d65bd492ba0146
parentc9b961748f79f875360d5519963d08f7972bb935 (diff)
downloadffmpeg-e266fcf0834a76c747483df408b23d5b9bb991e0.tar.gz
avformat/flac_picture: clear padding area
aviod use of uninitialized memory Fixes: asan_heap-oob_1487fa4_4706_cov_364534849_cover_art.flac Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 13aa82bbbb71c04bdcecf1341be4a23aee271bec) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/flac_picture.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c
index a58b3055c8..5f2026d1d0 100644
--- a/libavformat/flac_picture.c
+++ b/libavformat/flac_picture.c
@@ -110,6 +110,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
if (!(data = av_buffer_alloc(len + FF_INPUT_BUFFER_PADDING_SIZE))) {
RETURN_ERROR(AVERROR(ENOMEM));
}
+ memset(data->data + len, 0, FF_INPUT_BUFFER_PADDING_SIZE);
if (avio_read(pb, data->data, len) != len) {
av_log(s, AV_LOG_ERROR, "Error reading attached picture data.\n");
if (s->error_recognition & AV_EF_EXPLODE)