sdp: accept empty attribute value represented as a NULL pointer

Some empty media attribute values are set to an empty string, others as a NULL
pointer. It seems that code is able to deal with both, except for the UTF8
validation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6119>
This commit is contained in:
François Laignel 2024-02-23 15:20:41 +01:00 committed by GStreamer Marge Bot
parent aeaef7a7f0
commit d83184cf9a

View file

@ -4257,7 +4257,7 @@ sdp_add_attributes_to_caps (GArray * attributes, GstCaps * caps)
continue; continue;
/* string must be valid UTF8 */ /* string must be valid UTF8 */
if (!g_utf8_validate (attr->value, -1, NULL)) if (attr->value != NULL && !g_utf8_validate (attr->value, -1, NULL))
continue; continue;
if (!g_str_has_prefix (key, "x-")) if (!g_str_has_prefix (key, "x-"))