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

Fredrik Hubinette git at videolan.org
Fri Nov 17 00:26:59 EET 2017


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

avformat/mov: Check size of STSC allocation

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 79023ef369..d49d820d2b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2595,6 +2595,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[%u].stsc.entries = %u\n", c->fc->nb_streams - 1, entries);
 



More information about the ffmpeg-cvslog mailing list