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-02 00:28:59 +0100
commit74677deaca819c4a25b01488e0b69d9e984f103f (patch)
tree67ff48086123ecff03fb9f83a96838c8119efafc
parent4171249d7632ea4ea2964b992eca7adc12dacb76 (diff)
downloadffmpeg-74677deaca819c4a25b01488e0b69d9e984f103f.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 6768aa2792..85bf2e5211 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2248,6 +2248,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);