Commit b848f382 authored by Wim Taymans's avatar Wim Taymans
Browse files

rtcpbuffer: improve bye parsing

It is an error to ask for a non-existing BYE SSRC, the caller should
check the SSRC count first.
parent 3c66c2a4
......@@ -1423,17 +1423,12 @@ gst_rtcp_packet_bye_get_nth_ssrc (GstRTCPPacket * packet, guint nth)
guint8 *data;
guint offset;
guint32 ssrc;
guint8 sc;
g_return_val_if_fail (packet != NULL, 0);
g_return_val_if_fail (packet->type == GST_RTCP_TYPE_BYE, 0);
g_return_val_if_fail (packet->rtcp != NULL, 0);
g_return_val_if_fail (packet->rtcp->map.flags & GST_MAP_READ, 0);
/* get amount of sources and check that we don't read too much */
sc = packet->count;
if (nth >= sc)
return 0;
g_return_val_if_fail (nth < packet->count, 0);
/* get offset in 32-bits words into packet, skip the header */
offset = 1 + nth;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment