ogm: Fix division by 0
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Apr 2012 13:21:35 +0000 (15:21 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 18 Apr 2012 13:30:34 +0000 (15:30 +0200)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/oggparseogm.c

index 25857ee..43243f0 100644 (file)
@@ -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;