mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 00:58:12 +00:00
sdpsrc: fix double free if sdp is provided as string via the property
Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1532 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2025>
This commit is contained in:
parent
8d1a79e520
commit
438449db69
1 changed files with 4 additions and 1 deletions
|
@ -159,8 +159,11 @@ gst_sdp_src_change_state (GstElement * element, GstStateChange transition)
|
||||||
if (self->location && strcmp (self->location, "sdp://") != 0) {
|
if (self->location && strcmp (self->location, "sdp://") != 0) {
|
||||||
/* Do nothing */
|
/* Do nothing */
|
||||||
} else if (self->sdp) {
|
} else if (self->sdp) {
|
||||||
|
guint sdp_len = strlen (self->sdp);
|
||||||
|
|
||||||
self->sdp_buffer =
|
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 {
|
} else {
|
||||||
ret = GST_STATE_CHANGE_FAILURE;
|
ret = GST_STATE_CHANGE_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue