Index: webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc |
diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc |
index f9313a6724dd8908b0aa7cd7dc99bd9d8109d9c3..e86d5dba02f5547a48c29f315741eb074f2a9943 100644 |
--- a/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc |
+++ b/webrtc/modules/remote_bitrate_estimator/test/bwe_test_framework.cc |
@@ -15,6 +15,7 @@ |
#include <sstream> |
#include "webrtc/base/constructormagic.h" |
+#include "webrtc/base/safe_minmax.h" |
namespace webrtc { |
namespace testing { |
@@ -398,8 +399,8 @@ namespace { |
inline int64_t TruncatedNSigmaGaussian(Random* const random, |
int64_t mean, |
int64_t std_dev) { |
- int64_t gaussian_random = random->Gaussian(mean, std_dev); |
- return std::max(std::min(gaussian_random, kN * std_dev), -kN * std_dev); |
+ const int64_t gaussian_random = random->Gaussian(mean, std_dev); |
+ return rtc::SafeClamp(-kN * std_dev, kN * std_dev, gaussian_random); |
} |
} |