[Ffmpeg-cvslog] CVS: ffmpeg/libavformat utils.c,1.143,1.144

Michael Niedermayer CVS michael
Fri May 6 23:11:40 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv19984

Modified Files:
	utils.c 
Log Message:
division by zero fix


Index: utils.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/utils.c,v
retrieving revision 1.143
retrieving revision 1.144
diff -u -d -r1.143 -r1.144
--- utils.c	6 May 2005 20:26:50 -0000	1.143
+++ utils.c	6 May 2005 21:11:38 -0000	1.144
@@ -1841,12 +1841,12 @@
             if(st->codec.codec_id == CODEC_ID_RAWVIDEO && !st->codec.codec_tag && !st->codec.bits_per_sample)
                 st->codec.codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec.pix_fmt);
 
-            if(best_duration[i] < INT64_MAX && st->codec.time_base.num*1000 <= st->codec.time_base.den){
+            if(best_duration[i] < INT64_MAX && st->codec.time_base.num*1000 <= st->codec.time_base.den &&
+               st->time_base.num*best_duration[i]*1000LL > st->time_base.den){
                 int int_fps;
 
                 st->r_frame_rate.num= st->time_base.den;
                 st->r_frame_rate.den= st->time_base.num*best_duration[i];
-                av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, st->r_frame_rate.num, st->r_frame_rate.den, 1<<15);
                 
                 int_fps= av_rescale(st->r_frame_rate.num, 1, st->r_frame_rate.den); // 1/0
                 





More information about the ffmpeg-cvslog mailing list