Skip to content

Commit

Permalink
Add missing Feedback Control Information size check when getting rece…
Browse files Browse the repository at this point in the history
…iver ssrc from PLIs
  • Loading branch information
atoppi committed Oct 18, 2024
1 parent 8ef4bbe commit b092e3d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ guint32 janus_rtcp_get_receiver_ssrc(char *packet, int len) {
}
case RTCP_PSFB: {
/* PSFB, Payload-specific FB message (rfc4585) */
janus_rtcp_fb *rtcpfb = (janus_rtcp_fb *)rtcp;
return ntohl(rtcpfb->media);
if(rtcp->rc == 1) {
/* PLI has no FCI data */
if (!janus_rtcp_check_fci(rtcp, total, 0))
break;
janus_rtcp_fb *rtcpfb = (janus_rtcp_fb *)rtcp;
return ntohl(rtcpfb->media);
}
}
default:
break;
Expand Down

2 comments on commit b092e3d

@tmatth
Copy link
Contributor

@tmatth tmatth commented on b092e3d Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atoppi one thing I realized after the fact is that this should probably have a break to avoid the implicit fallthrough warning (and to not have weird behaviour should additional cases get added later).

@atoppi
Copy link
Member Author

@atoppi atoppi commented on b092e3d Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmatth Good catch! I will add it right away.

Please sign in to comment.