summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Hubinette <[email protected]>2017-11-15 17:24:30 -0800
committerMichael Niedermayer <[email protected]>2018-01-08 23:19:14 +0100
commit7d14046740234e26e01c4e097a09a58ffcadb8e8 (patch)
tree6c81dc8650e68c4e415dc97031d043b80c4225fb
parente69edb7aef67b01e94c1298b34366570dc83d717 (diff)
avformat/mov: Check size of STSC allocation
Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit a6fdd75fe6440d2f4150cb456a9078aa68b00fdb) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
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);