aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-13 00:35:12 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2017-01-06 19:58:42 +0100
commitd74c471a39db2919a0e1db9666df725cbcb83d86 (patch)
tree8b3db9648a1792a627ffe341f4347a4bdd9d968a
parent09905c412ddb2dc3dd24e5741f64a59c7610e8ea (diff)
downloadffmpeg-d74c471a39db2919a0e1db9666df725cbcb83d86.tar.gz
omadec: fix overflows during bit rate calculation
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/omadec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/omadec.c b/libavformat/omadec.c
index 6e476dbf25..757ae5371a 100644
--- a/libavformat/omadec.c
+++ b/libavformat/omadec.c
@@ -365,7 +365,7 @@ static int oma_read_header(AVFormatContext *s)
st->codecpar->channels = 2;
st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO;
st->codecpar->sample_rate = samplerate;
- st->codecpar->bit_rate = st->codecpar->sample_rate * framesize * 8 / 1024;
+ st->codecpar->bit_rate = st->codecpar->sample_rate * framesize / (1024 / 8);
/* fake the ATRAC3 extradata
* (wav format, makes stream copy to wav work) */
@@ -398,7 +398,7 @@ static int oma_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
st->codecpar->sample_rate = samplerate;
- st->codecpar->bit_rate = samplerate * framesize * 8 / 2048;
+ st->codecpar->bit_rate = samplerate * framesize / (2048 / 8);
avpriv_set_pts_info(st, 64, 1, samplerate);
break;
case OMA_CODECID_MP3: