1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Michael Niedermayer 2014-01-07 19:47:37 +01:00
parent 8aead3ffa8
commit 243b9fea90

View File

@ -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) {