[FFmpeg-cvslog] avformat/flvdec: initialize context before reading from it

Michael Niedermayer git at videolan.org
Fri Jan 10 21:05:53 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 10 20:58:19 2014 +0100| [396ddcf22d55fa7e735d69eed22a4a4b1649b73c] | committer: Michael Niedermayer

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 at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=396ddcf22d55fa7e735d69eed22a4a4b1649b73c
---

 libavformat/flvdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 5683ed5..2844cd3 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;



More information about the ffmpeg-cvslog mailing list