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

AAC config parser fix #651

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shurkaxaa
Copy link
Contributor

@shurkaxaa shurkaxaa commented Feb 7, 2022

Sometimes AAC fmtp.parameters.config much more than expected by the existing parser UInt16.
As a result, playback failed with error - RangeError: "value" argument is out of bounds.
It seems fmtp.parameters.config can contain more bytes than expected by this library.
For example for this stream - rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4.
Media information below.
And exactly the first four bytes contain proper - audio object type, frequency, etc...

              {                                                                                               
                "bandwidth": "128",                                                                           
                "bwtype": "AS",                                                                               
                "control": "trackID=1",                                                                       
                "fmt": 97,                                                                                    
                "fmtp": {                                                                                     
                    "format": "97",                                                                           
                    "parameters": {                                                                           
                        "config": "121056E500",                                                               
                        "indexdeltalength": "3",                                                              
                        "indexlength": "3",                                                                   
                        "mode": "AAC-hbr",                                                                    
                        "profile-level-id": "1",                                                              
                        "sizelength": "13"                                                                    
                    }                                                                                         
                },                                                                                            
                "port": 0,                                                                                    
                "protocol": "RTP/AVP",                                                                        
                "rtpmap": {                                                                                   
                    "clockrate": 44100,                                                                       
                    "encodingName": "MPEG4-GENERIC",                                                          
                    "encodingParameters": "2",                                                                
                    "payloadType": 97                                                                         
                },                                                                                            
                "type": "audio"                                                                               
            }                                                                                                 

@steabert steabert self-assigned this Sep 24, 2023
@steabert
Copy link
Member

This should be OK provided we know why it's only the first 4 characters?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants