fix(interceptor): clamp total_lost to signed 24-bit max per RFC 3550#77
Open
nightness wants to merge 1 commit intowebrtc-rs:masterfrom
Open
fix(interceptor): clamp total_lost to signed 24-bit max per RFC 3550#77nightness wants to merge 1 commit intowebrtc-rs:masterfrom
nightness wants to merge 1 commit intowebrtc-rs:masterfrom
Conversation
55726d4 to
7267904
Compare
RFC 3550 §6.4.1 defines total_lost as a 24-bit signed integer. The previous clamp used 0xFFFFFF (unsigned 24-bit max = 16,777,215) which allowed values that overflow the signed 24-bit range. Fix the clamp to 0x7FFFFF (signed 24-bit positive max = 8,388,607) so values are always representable in the reception report field.
7267904 to
65f0c5d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
receiver_stream.rs: fix thetotal_lostclamp from0xFFFFFF(unsigned 24-bit max = 16,777,215) to0x7FFFFF(signed 24-bit positive max = 8,388,607).RFC 3550 §6.4.1 defines
total_lostas a 24-bit signed integer. The RTCP reception report structure marshals it as a signed value (seertc-rtcpPR #69 which adds the> 0x7F_FFFFbounds check). The previous clamp at0xFFFFFFallowed values between0x800000and0xFFFFFFto pass, which are in-range for unsigned 24-bit but out-of-range for signed 24-bit — those values would fail or produce incorrect RTCP reports.Test plan
total_lostis clamped at 8,388,607 rather than wrapping or failing RTCP serialization