mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-27 13:30:45 +00:00
xwma: Validate channels and bits_per_coded_sample.
This prevents a SIGFPE later on. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
parent
86f2ae06b9
commit
5023b89bba
@ -115,6 +115,17 @@ static int xwma_read_header(AVFormatContext *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (!st->codec->channels) {
|
||||
av_log(s, AV_LOG_WARNING, "Invalid channel count: %d\n",
|
||||
st->codec->channels);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (!st->codec->bits_per_coded_sample) {
|
||||
av_log(s, AV_LOG_WARNING, "Invalid bits_per_coded_sample: %d\n",
|
||||
st->codec->bits_per_coded_sample);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* set the sample rate */
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user