au: validate sample rate

This commit is contained in:
Justin Ruggles 2012-12-23 13:39:31 -05:00
parent c837b38dd3
commit 47d029a4c1
1 changed files with 5 additions and 0 deletions

View File

@ -104,6 +104,11 @@ static int au_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
if (rate == 0 || rate > INT_MAX) {
av_log(s, AV_LOG_ERROR, "Invalid sample rate: %u\n", rate);
return AVERROR_INVALIDDATA;
}
/* now we are ready: build format streams */
st = avformat_new_stream(s, NULL);
if (!st)