aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-05-16 12:49:06 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-06-05 02:40:31 +0200
commited71759fd08b1b2c4760c5bc973318c534dc346a (patch)
tree75596fe11e30bac9ee9d2c534fbd1fbe7bbf9c4c
parentd7ae13d47934b9dd90a2d37bb97043d1f77a0452 (diff)
downloadffmpeg-ed71759fd08b1b2c4760c5bc973318c534dc346a.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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index a5ec3c3833..9352b24004 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2893,7 +2893,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