Commit 6085d6b2 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent feeb3a92
......@@ -2917,7 +2917,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment