1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

au: do not arbitrarily limit channel count

Nothing in the AU specification sets a limit on channel count.
We only need to avoid an overflow in the packet size calculation.
This commit is contained in:
Justin Ruggles 2012-12-23 13:26:44 -05:00
parent 2613de8805
commit fb48f825e3

View File

@ -57,6 +57,8 @@ static int au_probe(AVProbeData *p)
return 0;
}
#define BLOCK_SIZE 1024
/* au input */
static int au_read_header(AVFormatContext *s)
{
@ -92,7 +94,7 @@ static int au_read_header(AVFormatContext *s)
return AVERROR_PATCHWELCOME;
}
if (channels == 0 || channels > 64) {
if (channels == 0 || channels >= INT_MAX / (BLOCK_SIZE * bps >> 3)) {
av_log(s, AV_LOG_ERROR, "Invalid number of channels %d\n", channels);
return AVERROR_INVALIDDATA;
}
@ -117,8 +119,6 @@ static int au_read_header(AVFormatContext *s)
return 0;
}
#define BLOCK_SIZE 1024
static int au_read_packet(AVFormatContext *s,
AVPacket *pkt)
{