diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-12-13 00:38:25 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-12-14 01:06:55 +0100 |
commit | ad5807f8aa883bee5431186dc1f24c5435d722d3 (patch) | |
tree | d0d6dde8533ca046e122fe5bb7b35ee81b45cdac /libavformat/aiffdec.c | |
parent | 2b0112d42d4dfc8976be20b4d9729c0e077146c6 (diff) | |
download | ffmpeg-ad5807f8aa883bee5431186dc1f24c5435d722d3.tar.gz |
avformat: fix overflows during bit rate calculation
The bit_rate field has type int64_t since commit
7404f3bdb90e6a5dcb59bc0a091e2c5c038e557d.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/aiffdec.c')
-rw-r--r-- | libavformat/aiffdec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 59e969d12d..9e7a39c4ed 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -181,7 +181,7 @@ static int get_aiff_header(AVFormatContext *s, int size, par->block_align = (av_get_bits_per_sample(par->codec_id) * par->channels) >> 3; if (aiff->block_duration) { - par->bit_rate = par->sample_rate * (par->block_align << 3) / + par->bit_rate = (int64_t)par->sample_rate * (par->block_align << 3) / aiff->block_duration; } @@ -318,7 +318,7 @@ static int aiff_read_header(AVFormatContext *s) st->codecpar->block_align = 35; } aiff->block_duration = 160; - st->codecpar->bit_rate = st->codecpar->sample_rate * (st->codecpar->block_align << 3) / + st->codecpar->bit_rate = (int64_t)st->codecpar->sample_rate * (st->codecpar->block_align << 3) / aiff->block_duration; } break; |