Switch to an explicit limit of 0 for splitting on RTSP fmtp parameters

This commit is contained in:
Colin Barr 2021-08-03 10:33:49 +01:00
parent 6f67cb839c
commit 0921efab3e
No known key found for this signature in database
GPG key ID: 465A0A29B2554888

View file

@ -314,8 +314,8 @@ import java.util.HashMap;
// Format of the parameter: RFC3640 Section 4.4.1:
// <parameter name>=<value>[; <parameter name>=<value>].
// Split with implicit limit of 0 to handle an optional trailing semicolon.
String[] parameters = fmtpComponents[1].split(";\\s?");
// Split with an explicit limit of 0 to handle an optional trailing semicolon.
String[] parameters = fmtpComponents[1].split(";\\s?", /* limit= */ 0);
ImmutableMap.Builder<String, String> formatParametersBuilder = new ImmutableMap.Builder<>();
for (String parameter : parameters) {
// The parameter values can bear equal signs, so splitAtFirst must be used.