Commit 07728a11 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/binkaudio: clear padding area of packet_buffer

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f0dba198b34_2970_Snd0a3a2ad4.dee
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3d8eeea6
......@@ -306,6 +306,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
buf = av_realloc(s->packet_buffer, avpkt->size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!buf)
return AVERROR(ENOMEM);
memset(buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
s->packet_buffer = buf;
memcpy(s->packet_buffer, avpkt->data, avpkt->size);
if ((ret = init_get_bits8(gb, s->packet_buffer, avpkt->size)) < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment