@@ -55,15 +55,17 @@ 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.order = AV_CHANNEL_ORDER_UNSPEC;
+ 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);