diff options
author | Kristofer Björkström <kristofb@axis.com> | 2019-08-30 14:00:52 +0200 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2019-09-09 00:21:03 +0100 |
commit | a4e72b2162268eeaa19a68cd86e30394e4b0a449 (patch) | |
tree | 16bb021366bbb502c4fd1327e1187d81172c92d4 | |
parent | 533729a2c64681a7dbb2aa93c75f0891e7cf48d4 (diff) |
rtsp-client: RTP Info must exist in PLAY response
If RTP Info is missing. Then return GST_RTSP_STS_INTERNAL_SERVER_ERROR
Fixes #76
-rw-r--r-- | gst/rtsp-server/rtsp-client.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 3a839ec..1d8012a 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -1830,7 +1830,8 @@ handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx) } /* grab RTPInfo from the media now */ - rtpinfo = gst_rtsp_session_media_get_rtpinfo (sessmedia); + if (!(rtpinfo = gst_rtsp_session_media_get_rtpinfo (sessmedia))) + goto rtp_info_error; /* construct the response now */ code = GST_RTSP_STS_OK; @@ -1838,9 +1839,7 @@ handle_play_request (GstRTSPClient * client, GstRTSPContext * ctx) gst_rtsp_status_as_text (code), ctx->request); /* add the RTP-Info header */ - if (rtpinfo) - gst_rtsp_message_take_header (ctx->response, GST_RTSP_HDR_RTP_INFO, - rtpinfo); + gst_rtsp_message_take_header (ctx->response, GST_RTSP_HDR_RTP_INFO, rtpinfo); if (seek_style) gst_rtsp_message_add_header (ctx->response, GST_RTSP_HDR_SEEK_STYLE, seek_style); @@ -1927,6 +1926,12 @@ unsupported_mode: send_generic_response (client, GST_RTSP_STS_METHOD_NOT_ALLOWED, ctx); return FALSE; } +rtp_info_error: + { + GST_ERROR ("client %p: failed to add RTP-Info", client); + send_generic_response (client, GST_RTSP_STS_INTERNAL_SERVER_ERROR, ctx); + return FALSE; + } } static void |