From e79de93ea8426985d63a2369e8274ceaf296ba2d Mon Sep 17 00:00:00 2001
From: Fredrik Hubinette <hubbe@google.com>
Date: Wed, 15 Nov 2017 15:19:15 -0800
Subject: [PATCH] Check size of STSC allocation
---
libavformat/mov.c | 2 ++
1 file changed, 2 insertions(+)
@@ -2618,6 +2618,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);
--
2.15.0.448.gf294e3d99a-goog