From 01c15547d4aa632eb86873527343be0b5a349900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 2 Apr 2014 12:59:58 -0700 Subject: [PATCH] srtpdec: fix assertion checking ssrc from rtcp packets rtcp_buffer_get_ssrc is called even with RTP buffers. this means we might end up with an exception and not find any valid RTCP packet type and thus hit GST_RTCP_TYPE_INVALID. we now take care of this. https://bugzilla.gnome.org/show_bug.cgi?id=727512 --- ext/srtp/gstsrtp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/srtp/gstsrtp.c b/ext/srtp/gstsrtp.c index 0f0a77fa02..d371bf3c8c 100644 --- a/ext/srtp/gstsrtp.c +++ b/ext/srtp/gstsrtp.c @@ -149,8 +149,10 @@ rtcp_buffer_get_ssrc (GstBuffer * buf, guint32 * ssrc) return FALSE; if (gst_rtcp_buffer_get_first_packet (&rtcpbuf, &packet)) { + GstRTCPType type; do { - switch (gst_rtcp_packet_get_type (&packet)) { + type = gst_rtcp_packet_get_type (&packet); + switch (type) { case GST_RTCP_TYPE_RR: *ssrc = gst_rtcp_packet_rr_get_ssrc (&packet); ret = TRUE; @@ -163,7 +165,8 @@ rtcp_buffer_get_ssrc (GstBuffer * buf, guint32 * ssrc) default: break; } - } while (gst_rtcp_packet_move_to_next (&packet) && ret == FALSE); + } while ((ret == FALSE) && (type != GST_RTCP_TYPE_INVALID) && + gst_rtcp_packet_move_to_next (&packet)); } gst_rtcp_buffer_unmap (&rtcpbuf);