diff --git a/PacketDotNet/RtcpPacket.cs b/PacketDotNet/RtcpPacket.cs index b7ed9fa2..270e9854 100644 --- a/PacketDotNet/RtcpPacket.cs +++ b/PacketDotNet/RtcpPacket.cs @@ -117,7 +117,7 @@ public bool HasPadding public int ReceptionReportCount { get => (Header.Bytes[Header.Offset] & RtcpFields.ReceptionReportCountMask); - set => Header.Bytes[Header.Offset] |= (byte) (value & RtcpFields.ReceptionReportCountMask); + set => Header.Bytes[Header.Offset] = (byte) ((Header.Bytes[Header.Offset] & ~RtcpFields.ReceptionReportCountMask) | (value & RtcpFields.ReceptionReportCountMask)); } /// diff --git a/PacketDotNet/RtpPacket.cs b/PacketDotNet/RtpPacket.cs index df896aaa..37c8adcf 100644 --- a/PacketDotNet/RtpPacket.cs +++ b/PacketDotNet/RtpPacket.cs @@ -141,7 +141,7 @@ public int CsrcCount get => Header.Bytes[Header.Offset] & RtpFields.CsrcCountMask; set { - Header.Bytes[Header.Offset] |= (byte) (value & RtpFields.CsrcCountMask); + Header.Bytes[Header.Offset] = (byte) ((Header.Bytes[Header.Offset] & ~RtpFields.CsrcCountMask) | (value & RtpFields.CsrcCountMask)); Header.Length = RtpFields.HeaderLength + CsrcCount * RtpFields.CsrcIdLength; if (HasExtension) Header.Length += RtpFields.ProfileSpecificExtensionHeaderLength + RtpFields.ExtensionLengthLength + @@ -174,7 +174,7 @@ public bool Marker public int PayloadType { get => Header.Bytes[Header.Offset + 1] & RtpFields.PayloadTypeMask; - set => Header.Bytes[Header.Offset + 1] |= (byte) (value & RtpFields.PayloadTypeMask); + set => Header.Bytes[Header.Offset + 1] = (byte) ((Header.Bytes[Header.Offset + 1] & ~RtpFields.PayloadTypeMask) | (value & RtpFields.PayloadTypeMask)); } ///