[FFmpeg-cvslog] r19334 - trunk/libavformat/oggparsetheora.c

reimar subversion
Fri Jul 3 13:31:09 CEST 2009


Author: reimar
Date: Fri Jul  3 13:31:09 2009
New Revision: 19334

Log:
Replace invalid Theora frame rate by 25 FPS.
Avoids division by 0 due to e.g. time_base denominator being 0.

Modified:
   trunk/libavformat/oggparsetheora.c

Modified: trunk/libavformat/oggparsetheora.c
==============================================================================
--- trunk/libavformat/oggparsetheora.c	Fri Jul  3 13:27:52 2009	(r19333)
+++ trunk/libavformat/oggparsetheora.c	Fri Jul  3 13:31:09 2009	(r19334)
@@ -86,6 +86,11 @@ theora_header (AVFormatContext * s, int 
         }
         st->codec->time_base.den = get_bits_long(&gb, 32);
         st->codec->time_base.num = get_bits_long(&gb, 32);
+        if (!(st->codec->time_base.num > 0 && st->codec->time_base.den > 0)) {
+            av_log(s, AV_LOG_WARNING, "Invalid time base in theora stream, assuming 25 FPS\n");
+            st->codec->time_base.num = 1;
+            st->codec->time_base.den = 25;
+        }
         st->time_base = st->codec->time_base;
 
         st->sample_aspect_ratio.num = get_bits_long(&gb, 24);



More information about the ffmpeg-cvslog mailing list