Commit 9ed388f5 authored by Michael Niedermayer's avatar Michael Niedermayer

ogm: Fix division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 82010922
...@@ -89,7 +89,7 @@ ogm_header(AVFormatContext *s, int idx) ...@@ -89,7 +89,7 @@ ogm_header(AVFormatContext *s, int idx)
st->codec->channels = bytestream_get_le16(&p); st->codec->channels = bytestream_get_le16(&p);
p += 2; /* block_align */ p += 2; /* block_align */
st->codec->bit_rate = bytestream_get_le32(&p) * 8; st->codec->bit_rate = bytestream_get_le32(&p) * 8;
st->codec->sample_rate = spu * 10000000 / time_unit; st->codec->sample_rate = time_unit ? spu * 10000000 / time_unit : 0;
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate); avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
if (size >= 56 && st->codec->codec_id == CODEC_ID_AAC) { if (size >= 56 && st->codec->codec_id == CODEC_ID_AAC) {
p += 4; p += 4;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment