提交 d74c471a 编写于 作者: A Andreas Cadhalpun

omadec: fix overflows during bit rate calculation

Signed-off-by: NAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
上级 09905c41
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册