summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaakon Sporsheim <haakon@pexip.com>2017-08-25 11:57:26 +0200
committerTim-Philipp Müller <tim@centricular.com>2017-12-02 14:05:57 +0000
commita9ff979c595a891c954abbec883a6e0c2f68a23f (patch)
tree1cbf4d37a337fec0acc760fa3695a395d3fee3d4
parenteb1b38a506b0d876a9cd0e3894ce2e6a87b46aca (diff)
downloadgstreamer-plugins-good-a9ff979c595a891c954abbec883a6e0c2f68a23f.tar.gz
rtpsession: Handle zero length feedback packets
https://bugzilla.gnome.org/show_bug.cgi?id=791074
-rw-r--r--gst/rtpmanager/rtpsession.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index 089aef7cb..2ed38973e 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -2709,20 +2709,31 @@ static void
rtp_session_process_feedback (RTPSession * sess, GstRTCPPacket * packet,
RTPPacketInfo * pinfo, GstClockTime current_time)
{
- GstRTCPType type = gst_rtcp_packet_get_type (packet);
- GstRTCPFBType fbtype = gst_rtcp_packet_fb_get_type (packet);
- guint32 sender_ssrc = gst_rtcp_packet_fb_get_sender_ssrc (packet);
- guint32 media_ssrc = gst_rtcp_packet_fb_get_media_ssrc (packet);
- guint8 *fci_data = gst_rtcp_packet_fb_get_fci (packet);
- guint fci_length = 4 * gst_rtcp_packet_fb_get_fci_length (packet);
+ GstRTCPType type;
+ GstRTCPFBType fbtype;
+ guint32 sender_ssrc, media_ssrc;
+ guint8 *fci_data;
+ guint fci_length;
RTPSource *src;
+ /* The feedback packet must include both sender SSRC and media SSRC */
+ if (packet->length < 2)
+ return;
+
+ type = gst_rtcp_packet_get_type (packet);
+ fbtype = gst_rtcp_packet_fb_get_type (packet);
+ sender_ssrc = gst_rtcp_packet_fb_get_sender_ssrc (packet);
+ media_ssrc = gst_rtcp_packet_fb_get_media_ssrc (packet);
+
src = find_source (sess, media_ssrc);
/* skip non-bye packets for sources that are marked BYE */
if (sess->scheduled_bye && src && RTP_SOURCE_IS_MARKED_BYE (src))
return;
+ fci_data = gst_rtcp_packet_fb_get_fci (packet);
+ fci_length = gst_rtcp_packet_fb_get_fci_length (packet) * sizeof (guint32);
+
GST_DEBUG ("received feedback %d:%d from %08X about %08X with FCI of "
"length %d", type, fbtype, sender_ssrc, media_ssrc, fci_length);