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

Unified Diff: webrtc/media/base/rtpdataengine.cc

Issue 3007153003: Enable UBSan float-cast-overflow warnings and fix existing ones (Closed)
Patch Set: Fix/silence existing warnings Created 3 years, 3 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/media/base/rtpdataengine.cc
diff --git a/webrtc/media/base/rtpdataengine.cc b/webrtc/media/base/rtpdataengine.cc
index 89099e712d1c2edfa2b3334657845647bb4df2c3..d7aa32f80ede3a72b9c64092959b6f534429426f 100644
--- a/webrtc/media/base/rtpdataengine.cc
+++ b/webrtc/media/base/rtpdataengine.cc
@@ -18,6 +18,7 @@
#include "webrtc/rtc_base/helpers.h"
#include "webrtc/rtc_base/logging.h"
#include "webrtc/rtc_base/ratelimiter.h"
+#include "webrtc/rtc_base/sanitizer.h"
#include "webrtc/rtc_base/stringutils.h"
namespace cricket {
@@ -74,9 +75,12 @@ RtpDataMediaChannel::~RtpDataMediaChannel() {
}
}
-void RtpClock::Tick(double now, int* seq_num, uint32_t* timestamp) {
+void RTC_NO_SANITIZE("float-cast-overflow") // bugs.webrtc.org/8204
+RtpClock::Tick(double now, int* seq_num, uint32_t* timestamp) {
*seq_num = ++last_seq_num_;
*timestamp = timestamp_offset_ + static_cast<uint32_t>(now * clockrate_);
+ // UBSan: 5.92374e+10 is outside the range of representable values of type
+ // 'unsigned int'
}
const DataCodec* FindUnknownCodec(const std::vector<DataCodec>& codecs) {

Powered by Google App Engine
This is Rietveld 408576698