diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-16 14:30:33 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-06 00:45:04 +0200 |
commit | 25a28022390de45ca2c75497d213da51472f6c4f (patch) | |
tree | e1d69b15561a237fca5b1821ebdf94f555698227 | |
parent | 581a83082967ffd0bcb92c42085b009eb6551165 (diff) | |
download | ffmpeg-25a28022390de45ca2c75497d213da51472f6c4f.tar.gz |
4xmdemux: Check chunk size
Fixes over reading the header array
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 474e31c904f766b6989fe614c3fb093e697c847f)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/4xm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 3d9c5aea12..90a5fa0cbb 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -129,6 +129,10 @@ static int fourxm_read_header(AVFormatContext *s, for (i = 0; i < header_size - 8; i++) { fourcc_tag = AV_RL32(&header[i]); size = AV_RL32(&header[i + 4]); + if (size > header_size - i - 8 && (fourcc_tag == vtrk_TAG || fourcc_tag == strk_TAG)) { + av_log(s, AV_LOG_ERROR, "chunk larger than array %d>%d\n", size, header_size - i - 8); + return AVERROR_INVALIDDATA; + } if (fourcc_tag == std__TAG) { fourxm->fps = av_int2float(AV_RL32(&header[i + 12])); |