You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
oggparsespeex: 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:
@@ -68,6 +68,10 @@ static int speex_header(AVFormatContext *s, int idx) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
st->codecpar->sample_rate = AV_RL32(p + 36);
|
st->codecpar->sample_rate = AV_RL32(p + 36);
|
||||||
|
if (st->codecpar->sample_rate <= 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", st->codecpar->sample_rate);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
st->codecpar->channels = AV_RL32(p + 48);
|
st->codecpar->channels = AV_RL32(p + 48);
|
||||||
if (st->codecpar->channels < 1 || st->codecpar->channels > 2) {
|
if (st->codecpar->channels < 1 || st->codecpar->channels > 2) {
|
||||||
av_log(s, AV_LOG_ERROR, "invalid channel count. Speex must be mono or stereo.\n");
|
av_log(s, AV_LOG_ERROR, "invalid channel count. Speex must be mono or stereo.\n");
|
||||||
|
Reference in New Issue
Block a user