summaryrefslogtreecommitdiffstats
path: root/gst/rtsp/rtspmessage.c
diff options
context:
space:
mode:
authorLutz Mueller <lutz@topfrose.de>2006-09-18 11:29:12 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-09-18 11:29:12 +0000
commitcac807b641796e00d21a82e8704cbdf3992bedcb (patch)
tree3c760ed3ccb7af2f50582c31b34536a94f292f73 /gst/rtsp/rtspmessage.c
parentafd156ad0c89104040306ee4135d4ccd2190f3f7 (diff)
gst/rtsp/gstrtspsrc.*: Make sure we can never set an invalid location.
Original commit message from CVS: Based on patch by: Lutz Mueller <lutz at topfrose dot de> * 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.
Diffstat (limited to 'gst/rtsp/rtspmessage.c')
-rw-r--r--gst/rtsp/rtspmessage.c15
1 files changed, 15 insertions, 0 deletions
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)
{