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-10 23:45:43 +0100
commita1ed1c2193483849df689b105bec0d26c2497999 (patch)
treed7e353d34bd3534f0808eacccb48e2fdc979783c
parentc881f46a9c7e787df760bac64bf7807958885113 (diff)
downloadffmpeg-a1ed1c2193483849df689b105bec0d26c2497999.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>
-rw-r--r--libavformat/matroskadec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e05101f4f9..ae4dbf7b10 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;