[SCM] libav/experimental: Replace invalid Theora frame rate by 25 FPS. Avoids division by 0 due to e.g. time_base denominator being 0.
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 16:48:31 UTC 2013
The following commit has been merged in the experimental branch:
commit 11d058b7b351db8fb73104c847c5cc43b91735c6
Author: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
Date: Fri Jul 3 11:31:09 2009 +0000
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
diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c
index e62f288..0d74116 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);
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list