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>
This commit is contained in:
Andreas Cadhalpun 2016-10-23 16:48:01 +02:00
parent a398f054fd
commit 9d36602abc
1 changed files with 5 additions and 0 deletions

View File

@ -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);