mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
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
This commit is contained in:
parent
3dcddf82ed
commit
11d058b7b3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user