diff --git a/src/timestamp_history.cpp b/src/timestamp_history.cpp index ef35f87c3..c3a64ff9b 100644 --- a/src/timestamp_history.cpp +++ b/src/timestamp_history.cpp @@ -53,7 +53,8 @@ boost::uint32_t timestamp_history::add_sample(boost::uint32_t sample, bool step) m_num_samples = 0; } - ++m_num_samples; + // don't let the counter wrap + if (m_num_samples < 0xfffe) ++m_num_samples; // if sample is less than base, update the base // and update the history entry (because it will