aboutsummaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorJustin Ruggles2012-03-21 14:30:33 -0400
committerJustin Ruggles2012-03-22 11:45:36 -0400
commit02f88eec1d9069ab6bb6c4177471226186647a8f (patch)
treec45ee997d148b8ed8a907ab12c2e56cac22e8515 /libavformat
parent87818103a0d8e5021b950ea5906031a20d0d193b (diff)
aiffdec: do not set bit rate if block duration is unknown
CC: libav-stable@libav.org
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/aiffdec.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 11bbcac775..bbac1ab30e 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -157,8 +157,10 @@ static unsigned int get_aiff_header(AVFormatContext *s, int size,
if (!codec->block_align)
codec->block_align = (codec->bits_per_coded_sample * codec->channels) >> 3;
- codec->bit_rate = codec->sample_rate * (codec->block_align << 3) /
- aiff->block_duration;
+ if (aiff->block_duration) {
+ codec->bit_rate = codec->sample_rate * (codec->block_align << 3) /
+ aiff->block_duration;
+ }
/* Chunk is over */
if (size)