Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc

Issue 2157843002: Fix crash which happens when there's reordering in the beginning of a call. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comment. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc
index 524985c49077376454e17f61eb4feae8400e9d07..194ef56b25ea3e6a28aa6cec4285b84bd540f866 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.cc
@@ -89,7 +89,18 @@ void RemoteEstimatorProxy::Process() {
void RemoteEstimatorProxy::OnPacketArrival(uint16_t sequence_number,
int64_t arrival_time) {
+ // TODO(holmer): We should handle a backwards wrap here if the first
+ // sequence number was small and the new sequence number is large. The
+ // SequenceNumberUnwrapper doesn't do this, so we should replace this with
+ // calls to IsNewerSequenceNumber instead.
int64_t seq = unwrapper_.Unwrap(sequence_number);
+ if (seq > window_start_seq_ + 0xFFFF / 2) {
+ LOG(LS_WARNING) << "Skipping this sequence number (" << sequence_number
+ << ") since it likely is reordered, but the unwrapper"
+ "failed to handle it. Feedback window starts at "
+ << window_start_seq_ << ".";
+ return;
+ }
if (packet_arrival_times_.lower_bound(window_start_seq_) ==
packet_arrival_times_.end()) {

Powered by Google App Engine
This is Rietveld 408576698