Browse Source

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>
tags/n3.3
Andreas Cadhalpun 9 years ago
parent
commit
9d36602abc
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavformat/mov.c

+ 5
- 0
libavformat/mov.c 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);


Loading…
Cancel
Save