Commit a943a132 authored by Luca Barbato's avatar Luca Barbato

aac: check the maximum number of channels

Broken bitstreams could report a larger than specified number of
channels and cause outbound writes.

CC:libav-stable@libav.org
parent 1b6f84a9
......@@ -141,6 +141,8 @@ static av_cold int che_configure(AACContext *ac,
enum ChannelPosition che_pos,
int type, int id, int *channels)
{
if (*channels >= MAX_CHANNELS)
return AVERROR_INVALIDDATA;
if (che_pos) {
if (!ac->che[type][id]) {
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment