[FFmpeg-cvslog] avformat/flac_picture: clear padding area
Michael Niedermayer
git at videolan.org
Sun Feb 23 17:46:55 CET 2014
ffmpeg | branch: release/2.1 | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 31 17:31:21 2014 +0100| [e266fcf0834a76c747483df408b23d5b9bb991e0] | committer: Michael Niedermayer
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 at gmx.at>
(cherry picked from commit 13aa82bbbb71c04bdcecf1341be4a23aee271bec)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e266fcf0834a76c747483df408b23d5b9bb991e0
---
libavformat/flac_picture.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libavformat/flac_picture.c b/libavformat/flac_picture.c
index a58b305..5f2026d 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)
More information about the ffmpeg-cvslog
mailing list