mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-22 07:20:45 +00:00
xa: abort if number of channels or sample rate is 0
Fixes #2711. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
da8c9b324c
commit
ad194b0487
@ -84,6 +84,9 @@ static int xa_read_header(AVFormatContext *s)
|
||||
avio_skip(pb, 2); /* Skip block align */
|
||||
avio_skip(pb, 2); /* Skip bits-per-sample */
|
||||
|
||||
if (!st->codec->channels || !st->codec->sample_rate)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
st->codec->bit_rate = av_clip(15LL * st->codec->channels * 8 *
|
||||
st->codec->sample_rate / 28, 0, INT_MAX);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user