From b29a3545b7dab490edfbacdec40455049cc008a2 Mon Sep 17 00:00:00 2001 From: David Steele Date: Wed, 14 Jan 2015 12:19:06 +0000 Subject: [PATCH] Fixed overflow error with time values Frame time was converting system time (2 uint32's) into a uint64, but without promoting to uint64s first, so conversion from seconds to microseconds was overflowing. Change-Id: I0d7afa96d1f83d6bf1413647e118a4a44510fe35 Signed-off-by: David Steele --- adaptors/base/frame-time.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adaptors/base/frame-time.cpp b/adaptors/base/frame-time.cpp index b31b6df..345c278 100644 --- a/adaptors/base/frame-time.cpp +++ b/adaptors/base/frame-time.cpp @@ -225,7 +225,8 @@ inline void FrameTime::SetLastSyncTime() mPlatform.GetTimeMicroseconds( seconds, microseconds ); - mLastSyncTime = ( seconds * MICROSECONDS_PER_SECOND ) + microseconds; + mLastSyncTime = seconds; // Promote from 32 bit to 64 bit value + mLastSyncTime = ( mLastSyncTime * MICROSECONDS_PER_SECOND ) + microseconds; } } // namespace Adaptor -- 2.7.4