Browse Source

mov: Discard invalid CTTS.

Fixes Ticket385

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Michael Niedermayer 13 years ago
parent
commit
4093220029
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      libavformat/mov.c

+ 8
- 0
libavformat/mov.c View File

@@ -1774,6 +1774,14 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom)


sc->ctts_data[i].count = count; sc->ctts_data[i].count = count;
sc->ctts_data[i].duration= duration; sc->ctts_data[i].duration= duration;

if (FFABS(duration) > (1<<28) && i+2<entries) {
av_log(c->fc, AV_LOG_WARNING, "CTTS invalid\n");
av_freep(&sc->ctts_data);
sc->ctts_count = 0;
return 0;
}

if (duration < 0 && i+2<entries) if (duration < 0 && i+2<entries)
sc->dts_shift = FFMAX(sc->dts_shift, -duration); sc->dts_shift = FFMAX(sc->dts_shift, -duration);
} }


Loading…
Cancel
Save