[FFmpeg-devel] [PATCH] AAC: reject multiple channel configurations
Tue Jul 7 02:31:41 CEST 2009
Invalid second channel configurations are one of the biggest causes of
crashes in the AAC deocder in my experience. See issue 1254 for an
example. If they are even legal is dubious at best. From 14496-3:2005:
220.127.116.11 Program config element (PCE)
See ISO/IEC13818-7 (13818-7:2005, subclause 8.5 "Program Config Element (PCE)").
The following changes apply in the context of MPEG-4:
A program_config_element() may occur outside the AAC payload e. g. as
part of the GASpecificConfig() or the
adif_header(), but also inside the AAC payload as syntactic element in
Note that the channel configuration given in a
program_config_element() inside the AAC payload is evaluated only,
if no channel configuration is given outside the AAC payload. In the
context of ISO/IEC 14496-3 this is only the
case for MPEG-4 ADTS with channel_configation==0.
In any case only one program may be configured at a certain time.
18.104.22.168.1 Channel configuration
The AAC audio syntax provides three ways to convey the mapping of
channels within a set of syntactic elements to
physical locations of speakers. However in in the context of ISO/IEC
14496-3 only two of them are permitted.
22.214.171.124.1.1 Explicit channel mapping using default channel settings
Default channel mappings are defined in subpart 1, Table 1.17 (values
larger 0). If MPEG-4 Audio is used together
with the MPEG-4 Systems audio compositor only these mappings shall be used.
126.96.36.199.1.2 Explicit channel mapping using a program_config_element()
Any possible channel configuration can be specified using a
program_config_element().The same specifications
and restrictions as defined in ISO/IEC 13818-7 apply with respect to
the PCE when used in the context of
An MPEG-4 decoder is always required to parse any
program_config_element() inside the AAC payload. However,
the decoder is only required to evaluate it, if no channel
configuration is given outside the AAC payload.
188.8.131.52.1.3 Implicit channel mapping
This kind of channel mapping as specified in ISO/IEC13818-7 is not
permitted in the context of ISO/IEC 14496-3.
Even if they are legal we aren't reliably able to handle them at the
moment so they should be disabled.
The attached patch does not break conformance.
You may be curious why the patch does not just error out completely.
It is clear from the spec that the redundant PCE must be parsed.
Erroring would break concatenation of compatible ADTS files that
contain a PCE.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1178 bytes
Desc: not available
More information about the ffmpeg-devel