summaryrefslogtreecommitdiff
path: root/gst
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 13:58:34 +0000
commit3c0d006c03c4118df4700d17bf540615f2c634ed (patch)
tree6b025bc80d9ec103e1f508335823ba5dccf92fc9 /gst
parentb4ca81591cb76045c98ac1061eae0b200a3ea9f9 (diff)
rtpsession: Handle zero length feedback packets
https://bugzilla.gnome.org/show_bug.cgi?id=791074
Diffstat (limited to 'gst')
-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 7e63e1bb0..0b99d2383 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);