diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-05 00:16:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-09-17 15:57:27 +0200 |
commit | 29b950521504a51f8b60dfcabe3cc141c4e01554 (patch) | |
tree | 8da40c21518af24cae4ccaa4bad7e8e83642654b | |
parent | 5cc3add03695e6ebc6a924dee5fd12138e45bb45 (diff) | |
download | ffmpeg-29b950521504a51f8b60dfcabe3cc141c4e01554.tar.gz |
avformat/mov: Fix DoS in read_tfra()
Fixes: Missing EOF check in loop
No testcase
Found-by: Xiaohei and Wangchu from Alibaba Security Team
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9cb4eb772839c5e1de2855d126bf74ff16d13382)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/mov.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 1815a7303f..a4474b43b3 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -4862,6 +4862,13 @@ static int read_tfra(MOVContext *mov, AVIOContext *f) } for (i = 0; i < index->item_count; i++) { int64_t time, offset; + + if (avio_feof(f)) { + index->item_count = 0; + av_freep(&index->items); + return AVERROR_INVALIDDATA; + } + if (version == 1) { time = avio_rb64(f); offset = avio_rb64(f); |