Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
5a96e1fb
Commit
5a96e1fb
authored
8 years ago
by
Kevin Harwell
Committed by
Gerrit Code Review
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge "res_format_attr_opus: Fix crash when fmtp contains spaces."
parents
c796f00c
5c89604a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
res/res_format_attr_opus.c
+23
-15
23 additions, 15 deletions
res/res_format_attr_opus.c
with
23 additions
and
15 deletions
res/res_format_attr_opus.c
+
23
−
15
View file @
5a96e1fb
...
@@ -101,27 +101,35 @@ static int opus_clone(const struct ast_format *src, struct ast_format *dst)
...
@@ -101,27 +101,35 @@ static int opus_clone(const struct ast_format *src, struct ast_format *dst)
static
void
sdp_fmtp_get
(
const
char
*
attributes
,
const
char
*
name
,
int
*
attr
)
static
void
sdp_fmtp_get
(
const
char
*
attributes
,
const
char
*
name
,
int
*
attr
)
{
{
const
char
*
kvp
=
""
;
const
char
*
kvp
=
attributes
;
int
val
;
int
val
;
if
(
a
ttributes
&&
!
(
kvp
=
strstr
(
attributes
,
name
)
))
{
if
(
a
st_strlen_zero
(
attributes
))
{
return
;
return
;
}
}
/*
/* This logic goes through each attribute in the fmtp line looking for the
* If the named attribute is not at the start of the given attributes, and
* requested named attribute.
* the preceding character is not a space or semicolon then it's not the
* attribute we are looking for. It's an attribute with the name embedded
* within it (e.g. ptime in maxptime, stereo in sprop-stereo).
*/
*/
if
(
kvp
!=
attributes
&&
*
(
kvp
-
1
)
!=
' '
&&
*
(
kvp
-
1
)
!=
';'
)
{
while
(
*
kvp
)
{
/* Keep searching as it might still be in the attributes string */
/* Skip any preceeding blanks as some implementations separate attributes using spaces too */
sdp_fmtp_get
(
strchr
(
kvp
,
';'
),
name
,
attr
);
kvp
=
ast_skip_blanks
(
kvp
);
/*
* Otherwise it's a match, so retrieve the value and set the attribute.
/* If we are at at the requested attribute get its value and return */
*/
if
(
!
strncmp
(
kvp
,
name
,
strlen
(
name
))
&&
kvp
[
strlen
(
name
)]
==
'='
)
{
}
else
if
(
sscanf
(
kvp
,
"%*[^=]=%30d"
,
&
val
)
==
1
)
{
if
(
sscanf
(
kvp
,
"%*[^=]=%30d"
,
&
val
)
==
1
)
{
*
attr
=
val
;
*
attr
=
val
;
break
;
}
}
/* Move on to the next attribute if possible */
kvp
=
strchr
(
kvp
,
';'
);
if
(
!
kvp
)
{
break
;
}
kvp
++
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment