From: Tim-Philipp Müller Date: Fri, 19 Feb 2021 00:03:00 +0000 (+0000) Subject: sdpsrc: fix double free if sdp is provided as string via the property X-Git-Tag: 1.19.3~507^2~796 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=438449db697c7743a10dcbe20aeee5d39b0463bc;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/gst/sdp/gstsdpsrc.c b/gst/sdp/gstsdpsrc.c index 6945df559b..96b483d23a 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; }