[FFmpeg-cvslog] ff_choose_timebase: only try factors upto 14

Michael Niedermayer git at videolan.org
Wed Oct 3 22:17:57 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Oct  3 21:38:56 2012 +0200| [5e6439a12508f8f7f30aeef64eb96c2311b7f573] | committer: Michael Niedermayer

ff_choose_timebase: only try factors upto 14

otherwise a unexpected timebase could be choosen
that is one that is thousand times more precisse than requested
which can have sideeffects.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e6439a12508f8f7f30aeef64eb96c2311b7f573
---

 libavformat/mux.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index cd5481f..48f4d77 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -113,7 +113,7 @@ AVRational ff_choose_timebase(AVFormatContext *s, AVStream *st, int min_precissi
     } else {
         q = st->codec->time_base;
     }
-    for (j=2; j<2000; j+= 1+(j>2))
+    for (j=2; j<14; j+= 1+(j>2))
         while (q.den / q.num < min_precission && q.num % j == 0)
             q.num /= j;
     while (q.den / q.num < min_precission && q.den < (1<<24))



More information about the ffmpeg-cvslog mailing list