diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-11-14 14:07:58 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-11-14 14:08:44 +0100 |
commit | 87d073eaccc00ef2909445ae4b25128c440d9efa (patch) | |
tree | 2e0e5efc8c472776202a1222e870655b2639da91 /libavformat/mov.c | |
parent | a1b5c9634e87160251fd41635beb01da157cf00c (diff) | |
download | ffmpeg-87d073eaccc00ef2909445ae4b25128c440d9efa.tar.gz |
mov: Dont try to calculate with unknown durations, fix division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index f33a5ac555..01c9413759 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2232,8 +2232,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 > 0) + 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)) |