[FFmpeg-cvslog] ogm: Fix division by 0

Michael Niedermayer git at videolan.org
Wed Apr 18 15:35:20 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Apr 18 15:21:35 2012 +0200| [9ed388f5985992a0a6a43fdc0b1732962b6b5619] | committer: Michael Niedermayer

ogm: Fix division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ed388f5985992a0a6a43fdc0b1732962b6b5619
---

 libavformat/oggparseogm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c
index 25857ee..43243f0 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;



More information about the ffmpeg-cvslog mailing list