aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-04-18 15:21:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-04-18 15:30:34 +0200
commit9ed388f5985992a0a6a43fdc0b1732962b6b5619 (patch)
tree91c9a4c750519ce07c72282cbff076010d7c04af
parent820109224142323f182c2917e3d8ddc34324b5df (diff)
downloadffmpeg-9ed388f5985992a0a6a43fdc0b1732962b6b5619.tar.gz
ogm: Fix division by 0
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/oggparseogm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index 25857ee1fe..43243f042f 100644
--- a/libavformat/oggparseogm.c
+++ b/libavformat/oggparseogm.c
@@ -89,7 +89,7 @@ ogm_header(AVFormatContext *s, int idx)
st->codec->channels = bytestream_get_le16(&p);
p += 2; /* block_align */
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);
if (size >= 56 && st->codec->codec_id == CODEC_ID_AAC) {
p += 4;