Skip to content

Commit

Permalink
ogm: Fix division by 0
Browse files Browse the repository at this point in the history
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Apr 18, 2012
1 parent 8201092 commit 9ed388f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavformat/oggparseogm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9ed388f

Please sign in to comment.