[FFmpeg-cvslog] avformat/matroskadec: check generic audio deinterleaver sub_packet_size against frame_size

Michael Niedermayer git at videolan.org
Fri Jan 10 23:46:40 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan 10 23:10:47 2014 +0100| [a1ed1c2193483849df689b105bec0d26c2497999] | committer: Michael Niedermayer

avformat/matroskadec: check generic audio deinterleaver sub_packet_size against frame_size

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7f67d052a530_7517_nosound.mkv
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=a1ed1c2193483849df689b105bec0d26c2497999
---

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

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e05101f..ae4dbf7 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2181,7 +2181,7 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
             }
             memcpy(track->audio.buf + y*w, data, w);
         } else {
-            if (size < sps * w / sps || h<=0) {
+            if (size < sps * w / sps || h<=0 || w%sps) {
                 av_log(matroska->ctx, AV_LOG_ERROR,
                        "Corrupt generic RM-style audio packet size\n");
                 return AVERROR_INVALIDDATA;



More information about the ffmpeg-cvslog mailing list