summaryrefslogtreecommitdiff
path: root/libavformat/takdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-07 19:47:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-07 19:48:13 +0100
commit243b9fea90aade8cf8197fb8f362ccc03c7f6295 (patch)
tree0b1f464cc393fcca223648b690735bde0b083301 /libavformat/takdec.c
parent8aead3ffa89a7d92b54b049a63bf6485f643835b (diff)
downloadffmpeg-243b9fea90aade8cf8197fb8f362ccc03c7f6295.tar.gz
avformat/takdec: zero padding area before use
Fixes use of uninitialized memory Fixes: msan_uninit-mem_7fcecee73d71_6470_luckynight-partial.tak Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/takdec.c')
-rw-r--r--libavformat/takdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/takdec.c b/libavformat/takdec.c
index 2ed8a1e3b7..4888a77630 100644
--- a/libavformat/takdec.c
+++ b/libavformat/takdec.c
@@ -85,6 +85,7 @@ static int tak_read_header(AVFormatContext *s)
buffer = av_malloc(size - 3 + FF_INPUT_BUFFER_PADDING_SIZE);
if (!buffer)
return AVERROR(ENOMEM);
+ memset(buffer + size - 3, 0, FF_INPUT_BUFFER_PADDING_SIZE);
ffio_init_checksum(pb, tak_check_crc, 0xCE04B7U);
if (avio_read(pb, buffer, size - 3) != size - 3) {