mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 09:12:33 +00:00
adxdec: validate sample_rate
A negative sample rate doesn't make sense and triggers assertions in av_rescale_rnd. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
88db6c2890
commit
2eb05eaa68
@ -109,6 +109,11 @@ static int adx_read_header(AVFormatContext *s)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (par->sample_rate <= 0) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", par->sample_rate);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
par->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
par->codec_id = s->iformat->raw_codec_id;
|
||||
par->bit_rate = par->sample_rate * par->channels * BLOCK_SIZE * 8LL / BLOCK_SAMPLES;
|
||||
|
Loading…
Reference in New Issue
Block a user