aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-10 23:10:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-13 16:09:26 +0100
commit6da213ce208dabda3ce1d9e8d4fb72d337fa0b3f (patch)
tree6e5dab5e0a34843c656ee29ae85ae36ee808eb47
parent763a808c96bb1d95afe5a4b04d2688de4e605216 (diff)
downloadffmpeg-6da213ce208dabda3ce1d9e8d4fb72d337fa0b3f.tar.gz
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@gmx.at> (cherry picked from commit a1ed1c2193483849df689b105bec0d26c2497999) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index babf4b8060..cafc96edbb 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2178,7 +2178,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;