1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avformat/flvdec: initialize context before reading from it

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f9b8387069e_5377_flv_with_pcm_s16be_audio_track.flv
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-10 20:58:19 +01:00
parent e2bb185e62
commit 396ddcf22d

View File

@ -916,7 +916,7 @@ retry_duration:
flv->last_channels =
channels = st->codec->channels;
} else {
AVCodecContext ctx;
AVCodecContext ctx = {0};
ctx.sample_rate = sample_rate;
flv_set_audio_codec(s, st, &ctx, flags & FLV_AUDIO_CODECID_MASK);
sample_rate = ctx.sample_rate;