aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-09-05 00:16:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-09-10 01:33:28 +0200
commitd9cf9f5af82228b588828ae2692acccec588fdac (patch)
treeb7434f7cc98d9f7a9aff4abff974ddde57ad021c /libavformat
parent8a640fc7cb5e7110c679102007f795846e2a64e6 (diff)
downloadffmpeg-d9cf9f5af82228b588828ae2692acccec588fdac.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>
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 6b1cee8d6c..90b068f091 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5873,6 +5873,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);