diff --git a/libavformat/mov.c b/libavformat/mov.c index 9c724265393fb34cf85c9ed35103fcde2c1e7055..77ba4441fb4c265799dfa0bce745cb6b6ae580a0 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2130,7 +2130,7 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom) ((double)st->codec->width * sc->height), INT_MAX); } - if (st->duration != AV_NOPTS_VALUE) + if (st->duration != AV_NOPTS_VALUE && st->duration > 0) av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, sc->time_scale*st->nb_frames, st->duration, INT_MAX); } @@ -2863,7 +2863,7 @@ static int mov_read_header(AVFormatContext *s) for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; MOVStreamContext *sc = st->priv_data; - if (st->duration) + if (st->duration > 0) st->codec->bit_rate = sc->data_size * 8 * sc->time_scale / st->duration; } }