[FFmpeg-cvslog] mov: compute avg_frame_rate only if duration is known
Janne Grunau
git at videolan.org
Fri Dec 7 15:58:03 CET 2012
ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Fri Nov 23 16:33:36 2012 +0100| [80b6b31417c6791f9d4f1bc8c3c2a726d71e45e0] | committer: Janne Grunau
mov: compute avg_frame_rate only if duration is known
Fixes an assert in fuzzed sample sample.mp4_s265930.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80b6b31417c6791f9d4f1bc8c3c2a726d71e45e0
---
libavformat/mov.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index c6ff84b..a0ede86 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2052,8 +2052,9 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
((double)st->codec->width * sc->height), INT_MAX);
}
- av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
- sc->time_scale*st->nb_frames, st->duration, INT_MAX);
+ if (st->duration != AV_NOPTS_VALUE)
+ av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
+ sc->time_scale*st->nb_frames, st->duration, INT_MAX);
#if FF_API_R_FRAME_RATE
if (sc->stts_count == 1 || (sc->stts_count == 2 && sc->stts_data[1].count == 1))
More information about the ffmpeg-cvslog
mailing list