Commit 8269fbcb authored by Anton Khirnov's avatar Anton Khirnov Committed by James Almer

boa: convert to new channel layout API

Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 96b64bd9
......@@ -55,15 +55,16 @@ static int read_header(AVFormatContext *s)
avio_rl32(s->pb);
avio_rl32(s->pb);
st->codecpar->sample_rate = avio_rl32(s->pb);
st->codecpar->channels = avio_rl32(s->pb);
if (st->codecpar->channels > FF_SANE_NB_CHANNELS || st->codecpar->channels <= 0)
st->codecpar->ch_layout.nb_channels = avio_rl32(s->pb);
if (st->codecpar->ch_layout.nb_channels > FF_SANE_NB_CHANNELS ||
st->codecpar->ch_layout.order <= 0)
return AVERROR(ENOSYS);
ffformatcontext(s)->data_offset = data_offset = avio_rl32(s->pb);
avio_r8(s->pb);
st->codecpar->block_align = avio_rl32(s->pb);
if (st->codecpar->block_align > INT_MAX / FF_SANE_NB_CHANNELS || st->codecpar->block_align <= 0)
return AVERROR_INVALIDDATA;
st->codecpar->block_align *= st->codecpar->channels;
st->codecpar->block_align *= st->codecpar->ch_layout.nb_channels;
avio_seek(s->pb, data_offset, SEEK_SET);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment