audemux: Add a sanity check for the number of channels
Fixes a division by 0. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
a229d6c285
commit
0ca4414d0f
1 changed files with 5 additions and 0 deletions
|
@ -145,6 +145,11 @@ static int au_read_header(AVFormatContext *s)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channels == 0 || channels > 64) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Invalid number of channels %d\n", channels);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
if (size >= 24) {
|
if (size >= 24) {
|
||||||
/* skip unused data */
|
/* skip unused data */
|
||||||
avio_skip(pb, size - 24);
|
avio_skip(pb, size - 24);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue