diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-01 03:30:16 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-01 03:31:09 +0100 |
commit | 07728a111583be6865b7ce2adea705af9d207588 (patch) | |
tree | e5464b3791ab5313f77dd70926ba7afa55e4835e | |
parent | 3d8eeea62009a85c88ee4a630da4d6037920aa6e (diff) | |
download | ffmpeg-07728a111583be6865b7ce2adea705af9d207588.tar.gz |
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: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/binkaudio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 8db4533221..ffa32d12aa 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -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) |