[FFmpeg-cvslog] avformat/mov: Fix DoS in read_tfra()

Michael Niedermayer git at videolan.org
Thu Feb 1 01:50:06 EET 2018


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Tue Sep  5 00:16:29 2017 +0200| [dc4ef664ab385e4e1d44746c811a37445f3dedbe] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 9cb4eb772839c5e1de2855d126bf74ff16d13382)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc4ef664ab385e4e1d44746c811a37445f3dedbe
---

 libavformat/mov.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 478b50b5b2..0ff3c1cd48 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4408,6 +4408,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);



More information about the ffmpeg-cvslog mailing list