mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
rtcpbuffer: improve bye parsing
It is an error to ask for a non-existing BYE SSRC, the caller should check the SSRC count first.
This commit is contained in:
parent
3c66c2a43d
commit
b848f38215
1 changed files with 1 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue