Merge "Fix TracedValue compilation on Windows."
diff --git a/src/tracing/core/packet_stream_validator.cc b/src/tracing/core/packet_stream_validator.cc
index 3d2d846..72a20f5 100644
--- a/src/tracing/core/packet_stream_validator.cc
+++ b/src/tracing/core/packet_stream_validator.cc
@@ -72,8 +72,11 @@
     varint_ |= static_cast<uint64_t>(octet & 0x7F) << varint_shift_;
     if (octet & 0x80) {
       varint_shift_ += 7;
-      if (varint_shift_ >= 64)
+      if (varint_shift_ >= 64) {
+        // Do not invoke UB on next call.
+        varint_shift_ = 0;
         state_ = kInvalidVarInt;
+      }
       return 0;
     }
     uint64_t varint = varint_;