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

avcodec/shorten: clear bitstream buffer

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f3ca95606fb_6393_luckynight-partial.shn
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-12-23 18:09:58 +01:00
parent f371a4a57d
commit 1486ed0815

View File

@ -432,6 +432,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n"); av_log(avctx, AV_LOG_ERROR, "error allocating bitstream buffer\n");
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
memset(tmp_ptr, 0, s->allocated_bitstream_size);
s->bitstream = tmp_ptr; s->bitstream = tmp_ptr;
} }