Fix two UBSan warnings in NetEq
Both were related to very large jumps in RTP timestamps.
BUG=webrtc:5488
Review URL: https://codereview.webrtc.org/1685103002
Cr-Commit-Position: refs/heads/master@{#11569}
diff --git a/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc b/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc
index c1abdc3..b228e01 100644
--- a/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc
+++ b/webrtc/modules/audio_coding/neteq/timestamp_scaler.cc
@@ -75,7 +75,7 @@
internal_ref_ = external_timestamp;
first_packet_received_ = true;
}
- int32_t external_diff = external_timestamp - external_ref_;
+ int64_t external_diff = external_timestamp - external_ref_;
assert(denominator_ > 0); // Should not be possible.
external_ref_ = external_timestamp;
internal_ref_ += (external_diff * numerator_) / denominator_;
@@ -92,7 +92,7 @@
// Not initialized, or scale factor is 1.
return internal_timestamp;
} else {
- int32_t internal_diff = internal_timestamp - internal_ref_;
+ int64_t internal_diff = internal_timestamp - internal_ref_;
assert(numerator_ > 0); // Should not be possible.
// Do not update references in this method.
// Switch |denominator_| and |numerator_| to convert the other way.