1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

audemux: Check channels isnt 0

Fixes a division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-04-22 15:32:58 +02:00
parent fd2127ad53
commit 8aa57b7b5e

View File

@ -150,6 +150,11 @@ static int au_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
}
if (channels <= 0) {
av_log(s, AV_LOG_ERROR, "Invalid number of channels %d\n", channels);
return AVERROR_INVALIDDATA;
}
if (size >= 24) {
/* skip unused data */
avio_skip(pb, size - 24);