[FFmpeg-cvslog] avcodec/msmpeg4dec: initialize dir_ptr in error cases

Michael Niedermayer git at videolan.org
Sun Dec 15 13:34:30 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 15 13:22:57 2013 +0100| [61edda9a4a34573cd7335d17099a7b8d1553549a] | committer: Michael Niedermayer

avcodec/msmpeg4dec: initialize dir_ptr in error cases

Fixes use of uinitialized memory
Fixes: msan_uninit-mem_7f01b8799186_7278_msnaudio.asf
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=61edda9a4a34573cd7335d17099a7b8d1553549a
---

 libavcodec/msmpeg4dec.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/msmpeg4dec.c b/libavcodec/msmpeg4dec.c
index d689b18..a5845d8 100644
--- a/libavcodec/msmpeg4dec.c
+++ b/libavcodec/msmpeg4dec.c
@@ -588,6 +588,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
         }
         if (level < 0) {
             av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
+            *dir_ptr = 0;
             return -1;
         }
         level-=256;
@@ -599,6 +600,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
         }
         if (level < 0){
             av_log(s->avctx, AV_LOG_ERROR, "illegal dc vlc\n");
+            *dir_ptr = 0;
             return -1;
         }
 



More information about the ffmpeg-cvslog mailing list