diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2006-11-15 17:44:01 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2006-11-15 17:44:01 +0000 |
commit | 0cbacacba35ac4aeaad8fb5b0a5d67577c94edc6 (patch) | |
tree | c984bc0dc7eb7ab452c1f199a868ee0e4e9f547b /gst | |
parent | e8c55964bb31d47bc0459e119fed04f41d0cf8c9 (diff) |
gst/rtsp/rtspconnection.c: Don't set a data pointer to NULL and a size > 0 when we deal with empty packets.
Original commit message from CVS:
* gst/rtsp/rtspconnection.c: (read_body):
Don't set a data pointer to NULL and a size > 0 when we deal
with empty packets.
* gst/rtsp/rtspmessage.c: (rtsp_message_new_response),
(rtsp_message_init_response), (rtsp_message_init_data),
(rtsp_message_unset), (rtsp_message_free),
(rtsp_message_take_body):
Check that we can't create invalid empty packets.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtsp/rtspconnection.c | 4 | ||||
-rw-r--r-- | gst/rtsp/rtspmessage.c | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/gst/rtsp/rtspconnection.c b/gst/rtsp/rtspconnection.c index a0817f92..848f502f 100644 --- a/gst/rtsp/rtspconnection.c +++ b/gst/rtsp/rtspconnection.c @@ -588,8 +588,10 @@ read_body (RTSPConnection * conn, glong content_length, RTSPMessage * msg) RTSP_CHECK (rtsp_connection_read (conn, body, content_length), read_error); + content_length += 1; + done: - rtsp_message_take_body (msg, (guint8 *) body, content_length + 1); + rtsp_message_take_body (msg, (guint8 *) body, content_length); return RTSP_OK; diff --git a/gst/rtsp/rtspmessage.c b/gst/rtsp/rtspmessage.c index 333661d0..515ccb46 100644 --- a/gst/rtsp/rtspmessage.c +++ b/gst/rtsp/rtspmessage.c @@ -219,6 +219,7 @@ RTSPResult rtsp_message_take_body (RTSPMessage * msg, guint8 * data, guint size) { g_return_val_if_fail (msg != NULL, RTSP_EINVAL); + g_return_val_if_fail (data != NULL || size == 0, RTSP_EINVAL); if (msg->body) g_free (msg->body); |