From f3f7a4bf41487215ffb3eacb5cfff096b2577bf4 Mon Sep 17 00:00:00 2001 From: Katz Yamada Date: Tue, 12 Dec 2017 16:58:55 -0800 Subject: [PATCH] Fix incorrect cast to avoid integer overflow Fix incorrect cast in converting time uncertainty from integer based source to float. Change-Id: Ibb75eb1a2d925a7e7ce13275f09a618f241c31bf CRs-Fixed: 2157401 --- gnss/GnssAdapter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp index 7e4c8199..8ae382f5 100644 --- a/gnss/GnssAdapter.cpp +++ b/gnss/GnssAdapter.cpp @@ -3015,8 +3015,8 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) (int64_t)(reports.mTimeAndClock.back().mGpsTowMs); r.mTime.timeUncertaintyNs = - (float)((reports.mTimeAndClock.back().mTimeUnc + - reports.mTimeAndClock.back().mLeapSecUnc)*1000); + ((float)(reports.mTimeAndClock.back().mTimeUnc) + + (float)(reports.mTimeAndClock.back().mLeapSecUnc))*1000.0f; r.mTime.frequencyUncertaintyNsPerSec = (float)(reports.mTimeAndClock.back().mClockFreqBiasUnc); LOC_LOGV("getDebugReport - timeestimate=%" PRIu64 " unc=%f frequnc=%f",