[FFmpeg-devel] [PATCH] latmenc: Check for LOAS sync word

James Almer jamrial at gmail.com
Tue Jan 15 23:24:52 CET 2013

On 15/01/13 6:59 PM, Michael Niedermayer wrote:
> On Fri, Jan 11, 2013 at 09:27:37PM -0300, James Almer wrote:
>> As Kunhya said, that's the extent of the header.
>> I added a check to compare the size of the packet with the size
>> reported at the end
>> of the LOAS header (last 13 bits).
>> That should make sure only actual LOAS packets pass the entire set of checks.
> Iam not sure i understand, are you saying that
> a non LOAS packet cannot pass the checks or
> a non LOAS packet is unlikekly to pass the checks because you check
> more bits ?
> I think 24 bits is a bit weak if they arent forbidden to occur

A non loas packet is very unlikely to pass the check, yes.
It would have to start with the sync word (11 bits), and the next 13 bits should 
match the value of pkt->size.
The chances for this are very low, but still possible.

There isn't much else to do if we want to let libfdk-aac send loas packets to
the muxer, since that's the extent of the loas header and afaik there isn't 
anything else we could check.
The other option as i said is to remove the -latm avoption and make fdk-aac always
send raw packets with the necessary extradata the muxer expects, so it can encapsulate 
them itself.


More information about the ffmpeg-devel mailing list