diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2021-02-19 00:03:00 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-02-19 15:17:10 +0000 |
commit | a4a2f65dfabc41a2e24a79294fd019c4d6dac4c6 (patch) | |
tree | 413484e37f7df000f61721c15dfeb8dd846af9b0 /gst | |
parent | 1b0f035325ac4c54aa3900fd2281fef9ccd40e6a (diff) | |
download | gstreamer-plugins-bad-a4a2f65dfabc41a2e24a79294fd019c4d6dac4c6.tar.gz |
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/2027>
Diffstat (limited to 'gst')
-rw-r--r-- | gst/sdp/gstsdpsrc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gst/sdp/gstsdpsrc.c b/gst/sdp/gstsdpsrc.c index 6945df559..96b483d23 100644 --- a/gst/sdp/gstsdpsrc.c +++ b/gst/sdp/gstsdpsrc.c @@ -159,8 +159,11 @@ gst_sdp_src_change_state (GstElement * element, GstStateChange transition) 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; } |