Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling encrypted AAC frames when there's no encrypted data in a frame #4514

Merged
merged 1 commit into from
Feb 2, 2022

Commits on Jan 19, 2022

  1. Fix handling encrypted AAC frames when there's no encrypted data in a…

    … frame
    
    The `decryptAacSample()` was failing when the content size of the frame was
    less than 16 bytes (which is the size of unencrypted portion). Specifically,
    `curUnit.set(decryptedData, 16);` code was failing because `curUnit`
    was smaller than 16, so there was attempt to write outside of the buffer.
    
    According to the documentation [1], each AAC frame consists of
    * ADTS Header (7-9 bytes)
    * unencrypted leader (16 bytes)
    * a sequence of 16 bytes encrypted blocks (n x 16 bytes)
    * unencrypted trailer (0-15 bytes)
    
    In the failing case, the frame contained ADTS header (7 bytes), but the
    unencrypted leader was only 13 bytes long.
    
    [1] Section `2.3.1.1 AAC` https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption/Encryption/Encryption.html
    loganek committed Jan 19, 2022
    Configuration menu
    Copy the full SHA
    d10d864 View commit details
    Browse the repository at this point in the history