|
|
|
@ -47,14 +47,15 @@ static int svag_read_header(AVFormatContext *s) |
|
|
|
|
st->codecpar->sample_rate = avio_rl32(s->pb); |
|
|
|
|
if (st->codecpar->sample_rate <= 0) |
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
st->codecpar->channels = avio_rl32(s->pb); |
|
|
|
|
if (st->codecpar->channels <= 0 || st->codecpar->channels > 8) |
|
|
|
|
st->codecpar->ch_layout.nb_channels = avio_rl32(s->pb); |
|
|
|
|
if (st->codecpar->ch_layout.nb_channels <= 0 || |
|
|
|
|
st->codecpar->ch_layout.nb_channels > 8) |
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
st->duration = size / (16 * st->codecpar->channels) * 28; |
|
|
|
|
st->duration = size / (16 * st->codecpar->ch_layout.nb_channels) * 28; |
|
|
|
|
align = avio_rl32(s->pb); |
|
|
|
|
if (align <= 0 || align > INT_MAX / st->codecpar->channels) |
|
|
|
|
if (align <= 0 || align > INT_MAX / st->codecpar->ch_layout.nb_channels) |
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
st->codecpar->block_align = align * st->codecpar->channels; |
|
|
|
|
st->codecpar->block_align = align * st->codecpar->ch_layout.nb_channels; |
|
|
|
|
avio_skip(s->pb, 0x800 - avio_tell(s->pb)); |
|
|
|
|
avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); |
|
|
|
|
|
|
|
|
|