diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-05-16 12:49:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-08-15 18:54:34 +0200 |
commit | 8857dc6cd856b9f1eaf6c7f6c76b55f2ca95ef59 (patch) | |
tree | de43c4b5f96a3dbbe8182522da6ec3121f06ca29 | |
parent | 67c7f8ca143dc222ffa170dd190c02a0c74a155c (diff) | |
download | ffmpeg-8857dc6cd856b9f1eaf6c7f6c76b55f2ca95ef59.tar.gz |
ffmpeg: Check that r_frame_rate is set before attempting to use it
Avoids unexpected occurance and dependency on NaN behavior and divisions by 0
Testcase: fate-lavf-fate-avi_cram
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6085d6b2aeef28671614f625601a23cfc922d282)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | ffmpeg.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2882,7 +2882,8 @@ static int transcode_init(void) * overhead */ if(!strcmp(oc->oformat->name, "avi")) { - if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate) + if ( copy_tb<0 && ist->st->r_frame_rate.num + && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate) && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base) && 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(dec_ctx->time_base) && av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500 |