Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-09-05 01:16:29 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-09-07 16:19:22 +0300
commit9cb4eb772839c5e1de2855d126bf74ff16d13382 (patch)
tree62b96c5af734dc84ab9b71c5bd6521669db6023b /libavformat
parent913feb6263e0404311f3f791b5d1d013708836d6 (diff)
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 994e9c6eba..2519707345 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6094,6 +6094,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);