From cac807b641796e00d21a82e8704cbdf3992bedcb Mon Sep 17 00:00:00 2001 From: Lutz Mueller Date: Mon, 18 Sep 2006 11:29:12 +0000 Subject: gst/rtsp/gstrtspsrc.*: Make sure we can never set an invalid location. Original commit message from CVS: Based on patch by: Lutz Mueller * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_class_init), (gst_rtspsrc_init), (gst_rtspsrc_set_property), (gst_rtspsrc_open), (gst_rtspsrc_uri_get_uri), (gst_rtspsrc_uri_set_uri): * gst/rtsp/gstrtspsrc.h: Make sure we can never set an invalid location. * gst/rtsp/rtspmessage.c: (rtsp_message_steal_body): * gst/rtsp/rtspmessage.h: Added _steal_body method for future use. * gst/rtsp/rtspurl.c: (rtsp_url_parse), (rtsp_url_free): Make freeing of NULL url return immediatly. --- gst/rtsp/rtspmessage.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gst/rtsp/rtspmessage.c') diff --git a/gst/rtsp/rtspmessage.c b/gst/rtsp/rtspmessage.c index 4c9571f9..fd45f599 100644 --- a/gst/rtsp/rtspmessage.c +++ b/gst/rtsp/rtspmessage.c @@ -196,6 +196,21 @@ rtsp_message_get_body (RTSPMessage * msg, guint8 ** data, guint * size) return RTSP_OK; } +RTSPResult +rtsp_message_steal_body (RTSPMessage * msg, guint8 ** data, guint * size) +{ + if (msg == NULL || data == NULL || size == NULL) + return RTSP_EINVAL; + + *data = msg->body; + *size = msg->body_size; + + msg->body = NULL; + msg->body_size = 0; + + return RTSP_OK; +} + static void dump_mem (guint8 * mem, gint size) { -- cgit