summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2014-01-10 20:58:19 +0100
committerMichael Niedermayer <[email protected]>2014-01-13 16:09:22 +0100
commit763a808c96bb1d95afe5a4b04d2688de4e605216 (patch)
tree2b43a0f20693321f56440b5b4182b2a4c237cc5e
parent4f3b0afaa236f4c1cf0cce4b3b014af647b4e4a6 (diff)
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 <[email protected]> (cherry picked from commit 396ddcf22d55fa7e735d69eed22a4a4b1649b73c) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/flvdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 1024001a47..e2498db7ed 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -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;