aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Hubinette <hubbe@google.com>2017-11-15 17:24:30 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2017-12-30 21:11:31 +0100
commit74104d2dc05d903a2b94e3457fc1a2cf8fe224a2 (patch)
treeb5881608d2ea54ed512088fb4530c2af225bd147
parent066c65737682817611ad2f30a4895acb5f47629b (diff)
downloadffmpeg-74104d2dc05d903a2b94e3457fc1a2cf8fe224a2.tar.gz
avformat/mov: Check size of STSC allocation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit a6fdd75fe6440d2f4150cb456a9078aa68b00fdb) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 90b068f091..6ebdf8a4b7 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2411,6 +2411,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);