ffmpeg | branch: release/3.2 | Fredrik Hubinette <hu...@google.com> | Wed Nov 
15 17:24:30 2017 -0800| [7d14046740234e26e01c4e097a09a58ffcadb8e8] | committer: 
Michael Niedermayer

avformat/mov: Check size of STSC allocation

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
(cherry picked from commit a6fdd75fe6440d2f4150cb456a9078aa68b00fdb)
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index b97aa001a3..7547c78957 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2390,6 +2390,8 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
     avio_rb24(pb); /* flags */
 
     entries = avio_rb32(pb);
+    if ((uint64_t)entries * 12 + 4 > atom.size)
+        return AVERROR_INVALIDDATA;
 
     av_log(c->fc, AV_LOG_TRACE, "track[%i].stsc.entries = %i\n", 
c->fc->nb_streams-1, entries);
 

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

Reply via email to