mirror of https://git.ffmpeg.org/ffmpeg.git
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>
This commit is contained in:
parent
c881f46a9c
commit
a1ed1c2193
|
@ -2181,7 +2181,7 @@ static int matroska_parse_rm_audio(MatroskaDemuxContext *matroska,
|
||||||
}
|
}
|
||||||
memcpy(track->audio.buf + y*w, data, w);
|
memcpy(track->audio.buf + y*w, data, w);
|
||||||
} else {
|
} else {
|
||||||
if (size < sps * w / sps || h<=0) {
|
if (size < sps * w / sps || h<=0 || w%sps) {
|
||||||
av_log(matroska->ctx, AV_LOG_ERROR,
|
av_log(matroska->ctx, AV_LOG_ERROR,
|
||||||
"Corrupt generic RM-style audio packet size\n");
|
"Corrupt generic RM-style audio packet size\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
Loading…
Reference in New Issue