summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Conchillo FlaquƩ <aleix@oblong.com>2014-04-02 12:59:58 -0700
committerWim Taymans <wtaymans@redhat.com>2014-04-12 05:08:20 +0200
commit01c15547d4aa632eb86873527343be0b5a349900 (patch)
tree68f77b7ba2d06e11ca3de009895c01df42881cd6
parent78acb90a80d97c429cf1acc731429670c2c611a4 (diff)
downloadgstreamer-plugins-bad-01c15547d4aa632eb86873527343be0b5a349900.tar.gz
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
-rw-r--r--ext/srtp/gstsrtp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/srtp/gstsrtp.c b/ext/srtp/gstsrtp.c
index 0f0a77fa0..d371bf3c8 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);