Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1532
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2025>
if (self->location && strcmp (self->location, "sdp://") != 0) {
/* Do nothing */
} else if (self->sdp) {
+ guint sdp_len = strlen (self->sdp);
+
self->sdp_buffer =
- gst_buffer_new_wrapped (self->sdp, strlen (self->sdp) + 1);
+ gst_buffer_new_wrapped (g_strndup (self->sdp, sdp_len),
+ sdp_len + 1);
} else {
ret = GST_STATE_CHANGE_FAILURE;
}