From 4024e6b7756c0754846cbcbcd1b2f69be84a7f38 Mon Sep 17 00:00:00 2001 From: Patricia Muscalu Date: Wed, 22 Feb 2023 14:14:15 +0100 Subject: [PATCH] rtspconnection: Annotate RTSP message parameters correctly These parameters are not actually `out` parameters but must be allocated and zero-initialized by the calling function. Marking them as `out caller-allocates` will cause memory corruptions when calling these APIs from e.g., Python code. Part-of: --- .../gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c | 4 ++-- subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspmessage.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c index 8e63747..ae1e9d4 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspconnection.c @@ -2807,7 +2807,7 @@ no_message: /** * gst_rtsp_connection_receive_usec: * @conn: a #GstRTSPConnection - * @message: (out caller-allocates): the message to read + * @message: (transfer none): the message to read * @timeout: a timeout value or 0 * * Attempt to read into @message from the connected @conn, blocking up to @@ -5158,7 +5158,7 @@ gst_rtsp_connection_send_messages (GstRTSPConnection * conn, /** * gst_rtsp_connection_receive: * @conn: a #GstRTSPConnection - * @message: (out caller-allocates): the message to read + * @message: (transfer none): the message to read * @timeout: a timeout value or %NULL * * Attempt to read into @message from the connected @conn, blocking up to diff --git a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspmessage.c b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspmessage.c index 00f87e7..ed62636 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspmessage.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/rtsp/gstrtspmessage.c @@ -136,7 +136,7 @@ gst_rtsp_message_new (GstRTSPMessage ** msg) /** * gst_rtsp_message_init: - * @msg: (out caller-allocates): a #GstRTSPMessage + * @msg: (transfer none): a #GstRTSPMessage * * Initialize @msg. This function is mostly used when @msg is allocated on the * stack. The reverse operation of this is gst_rtsp_message_unset(). @@ -201,7 +201,7 @@ gst_rtsp_message_new_request (GstRTSPMessage ** msg, GstRTSPMethod method, /** * gst_rtsp_message_init_request: - * @msg: (out caller-allocates): a #GstRTSPMessage + * @msg: (transfer none): a #GstRTSPMessage * @method: the request method to use * @uri: (transfer none): the uri of the request * @@ -295,7 +295,7 @@ gst_rtsp_message_new_response (GstRTSPMessage ** msg, GstRTSPStatusCode code, /** * gst_rtsp_message_init_response: - * @msg: (out caller-allocates): a #GstRTSPMessage + * @msg: (transfer none): a #GstRTSPMessage * @code: the status code * @reason: (transfer none) (nullable): the status reason or %NULL * @request: (transfer none) (nullable): the request that triggered the response or %NULL @@ -421,7 +421,7 @@ gst_rtsp_message_new_data (GstRTSPMessage ** msg, guint8 channel) /** * gst_rtsp_message_init_data: - * @msg: (out caller-allocates): a #GstRTSPMessage + * @msg: (transfer none): a #GstRTSPMessage * @channel: a channel * * Initialize a new data #GstRTSPMessage for @channel. -- 2.7.4