aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/oggparsetheora.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-03 11:31:09 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-07-03 11:31:09 +0000
commit11d058b7b351db8fb73104c847c5cc43b91735c6 (patch)
treeaea1dedc16362c99efe300b849fd559a1306f443 /libavformat/oggparsetheora.c
parent3dcddf82edeb79a51a030191be6d4e816556c8ef (diff)
downloadffmpeg-11d058b7b351db8fb73104c847c5cc43b91735c6.tar.gz
Replace invalid Theora frame rate by 25 FPS.
Avoids division by 0 due to e.g. time_base denominator being 0. Originally committed as revision 19334 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/oggparsetheora.c')
-rw-r--r--libavformat/oggparsetheora.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c
index e62f288a7d..0d74116d17 100644
--- a/libavformat/oggparsetheora.c
+++ b/libavformat/oggparsetheora.c
@@ -86,6 +86,11 @@ theora_header (AVFormatContext * s, int idx)
}
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);