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

fmtp parser: checks parameterPair.length before accessing parameterPair[1] #2193

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

Conversation

nodinosaur
Copy link

MediaDescription.getFmtpParametersAsMap() can throw an ArrayIndexOutOfBoundsException with RTSP feeds.

Error thrown

java.lang.ArrayIndexOutOfBoundsException: length=1; index=1          
at androidx.media3.exoplayer.rtsp.MediaDescription.getFmtpParametersAsMap(MediaDescription.java:394) 

attributes sent as follows:

96 packetization-mode=1;profile-level-id=4D4028;sprop-parameter-sets=Z01AKJ2oHgCJ+WEAAAMAAQAAAwAehA==,aO48gA==

then

0 PCMA/8000

passes

checkArgument(fmtpComponents.length == 2, fmtpAttributeValue);

but would fail

formatParametersBuilder.put(parameterPair[0], parameterPair[1]);

as parameterPair[1] does not exist.
This code checks parameterPair.length before accessing parameterPair[1]

Catching this issue enables the RTSP stream to play with no issue.

Copy link

Important

The terms of service for this installation has not been accepted. Please ask the Organization owners to visit the Gemini Code Assist Admin Console to sign it.

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.

2 participants