Skip to content

Commit

Permalink
Merge pull request #24 from dimhotepus/fix-incorrect-overflow-check
Browse files Browse the repository at this point in the history
rtcp: Fix check for LengthInWordsMinusOne out of bounds
  • Loading branch information
juliusfriedman committed Oct 25, 2023
2 parents 466cd90 + 856ed54 commit 10ccf4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Rtp/Rtcp/RtcpHeader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public int LengthInWordsMinusOne
/*CheckDisposed();*/

//Write the value
if (value > RtcpHeader.MinimumLengthInWords) throw Binary.CreateOverflowException("LengthInWordsMinusOne", value, ushort.MinValue.ToString(), ushort.MaxValue.ToString());
if (value < RtcpHeader.MinimumLengthInWords || value > RtcpHeader.MaximumLengthInWords) throw Binary.CreateOverflowException("LengthInWordsMinusOne", value, RtcpHeader.MinimumLengthInWords.ToString(), RtcpHeader.MaximumLengthInWords.ToString());

Binary.Write16(SegmentToLast6Bytes.Array, SegmentToLast6Bytes.Offset, Common.Binary.IsLittleEndian, (ushort)value);
}
Expand Down

0 comments on commit 10ccf4f

Please sign in to comment.