Skip to content

Commit

Permalink
frame header was always found when length >= 0
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusfriedman committed Nov 21, 2023
1 parent ddb757a commit c4a21c8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Rtp/RtpClient.Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1619,8 +1619,8 @@ int ReadApplicationLayerFraming(ref int received, ref int sessionRequired, ref i
//Assign jumbo, If a frame was found (Including the null packet)
if (frameLength >= Common.Binary.Zero)
{
//Determine if a frameHeader was found
hasFrameHeader = frameLength > sessionRequired;
//Determine if a frameHeader was found...
hasFrameHeader = true;

//Determine how large the packet is
jumbo = frameLength > bufferLength;
Expand Down Expand Up @@ -1677,13 +1677,13 @@ int ReadApplicationLayerFraming(ref int received, ref int sessionRequired, ref i
using (RFC3550.CommonHeaderBits common = new RFC3550.CommonHeaderBits(buffer, offset + sessionRequired))
{
//Check the version...
incompatible = false.Equals(common.Version.Equals(relevent.Version));
incompatible = common.Version.Equals(relevent.Version) is false;

//If this is a valid context there must be at least a RtpHeader's worth of data in the buffer.
//If this was a RtcpPacket with only 4 bytes it wouldn't have a ssrc and wouldn't be valid to be sent.
if (incompatible is false &&
(frameChannel.Equals(relevent.DataChannel) &&
remainingInBuffer < Rtp.RtpHeader.Length + sessionRequired)
frameChannel.Equals(relevent.DataChannel) &&
remainingInBuffer < Rtp.RtpHeader.Length + sessionRequired
||
(frameChannel.Equals(relevent.ControlChannel) &&
remainingInBuffer < Rtcp.RtcpHeader.Length + sessionRequired))
Expand Down

0 comments on commit c4a21c8

Please sign in to comment.