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

avformat/jvdec: clear packet padding after downsize

Fixes: use of uninitialized memeory
Fixes: msan_uninit-mem_7fbf26b5fefe_5981_intro.jv
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-15 23:06:30 +01:00
parent 1a01dc8343
commit b948ab8132

View File

@ -190,6 +190,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->data[4] = jvf->video_type;
if ((size = avio_read(pb, pkt->data + JV_PREAMBLE_SIZE, size)) < 0)
return AVERROR(EIO);
memset(pkt->data + JV_PREAMBLE_SIZE + size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
pkt->size = size + JV_PREAMBLE_SIZE;
pkt->stream_index = 1;