From 12aa3925d06e67957b466e844eca0e486d261abb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 29 Nov 2022 14:02:55 +0200 Subject: [PATCH] sdpmessage: Annotate SDP message parameters for `parse_uri()` and `parse_buffer()` correctly They are not actually `out` parameters but must be allocated and initialized to a valid SDP message by the caller. Just allocating them without initialization will cause memory corruptions because the functions will try to clear/append to the existing SDP message. As such they should be just marked as `transfer none`. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1605 Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c index 17e1f64bd7..1de3849281 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c @@ -620,7 +620,7 @@ hex_to_int (gchar c) /** * gst_sdp_message_parse_uri: * @uri: the start of the uri - * @msg: (out caller-allocates): the result #GstSDPMessage + * @msg: (transfer none): the result #GstSDPMessage * * Parse the null-terminated @uri and store the result in @msg. * @@ -3121,7 +3121,7 @@ gst_sdp_parse_line (SDPContext * c, gchar type, gchar * buffer) * gst_sdp_message_parse_buffer: * @data: (array length=size): the start of the buffer * @size: the size of the buffer - * @msg: (out caller-allocates): the result #GstSDPMessage + * @msg: (transfer none): the result #GstSDPMessage * * Parse the contents of @size bytes pointed to by @data and store the result in * @msg.