aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-10-23 16:48:01 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-07 00:51:49 +0100
commit9d36602abc4ef5b69b92feadf868c77e5e9ccc7d (patch)
treeff8b48d385237237cab324af99f63dd9165e6b0b
parenta398f054fdb9b0f0b5a91c231fba6ce014143f71 (diff)
downloadffmpeg-9d36602abc4ef5b69b92feadf868c77e5e9ccc7d.tar.gz
mov: validate sidx timescale
A negative timescale doesn't make sense and triggers assertions in av_rescale_rnd. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/mov.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 5fb345a461..f06de061ad 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4247,6 +4247,11 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
timescale = av_make_q(1, avio_rb32(pb));
+ if (timescale.den <= 0) {
+ av_log(c->fc, AV_LOG_ERROR, "Invalid sidx timescale 1/%d\n", timescale.den);
+ return AVERROR_INVALIDDATA;
+ }
+
if (version == 0) {
pts = avio_rb32(pb);
offset += avio_rb32(pb);