You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
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
This commit is contained in:
@@ -141,6 +141,8 @@ static av_cold int che_configure(AACContext *ac,
|
|||||||
enum ChannelPosition che_pos,
|
enum ChannelPosition che_pos,
|
||||||
int type, int id, int *channels)
|
int type, int id, int *channels)
|
||||||
{
|
{
|
||||||
|
if (*channels >= MAX_CHANNELS)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
if (che_pos) {
|
if (che_pos) {
|
||||||
if (!ac->che[type][id]) {
|
if (!ac->che[type][id]) {
|
||||||
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
|
if (!(ac->che[type][id] = av_mallocz(sizeof(ChannelElement))))
|
||||||
|
Reference in New Issue
Block a user