MT#61856 sdp.c: manipulations (add) check if `a=` given

If `a=` has been given as part of the manipulation flags,
then this would lead to appending `a=a=`, so instead check it,
and if already there, then skip adding our own.

Change-Id: If943fac403fc3942cad8ad89be14fe4689b9974e
pull/1126/merge
Donat Zenichev 1 week ago
parent f41feae811
commit 2b8b628373

@ -374,7 +374,9 @@ static void sdp_manipulations_add(GString *s, const struct sdp_manipulations * s
for (auto_iter(l, q_ptr->head); l; l = l->next)
{
str * attr_value = l->data;
g_string_append_len(s, "a=", 2);
/* add a= only when not given by manipulation flags */
if (attr_value->len >= 2 && strncmp(attr_value->s, "a=", 2))
g_string_append_len(s, "a=", 2);
g_string_append_len(s, attr_value->s, attr_value->len);
g_string_append_len(s, "\r\n", 2);
}

Loading…
Cancel
Save