[FFmpeg-cvslog] avformat/mov: Check size of STSC allocation

Fredrik Hubinette git at videolan.org
Thu Feb 1 01:51:34 EET 2018


ffmpeg | branch: release/2.8 | Fredrik Hubinette <hubbe at google.com> | Wed Nov 15 17:24:30 2017 -0800| [c11ac27f49f799231999515c0a417ad27eb38be5] | committer: Michael Niedermayer

avformat/mov: Check size of STSC allocation

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

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

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

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



More information about the ffmpeg-cvslog mailing list