From 32d9e5d9e1019149f04817de9f988d01ed2d92b6 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 28 Jun 2015 21:21:00 -0400 Subject: [PATCH] Fix Coverity 1161256 Part of the for loop's condition was being discarded. Changed to while loop and utilize the correct condition. --- Sources/Plasma/PubUtilLib/plInterp/plController.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plInterp/plController.cpp b/Sources/Plasma/PubUtilLib/plInterp/plController.cpp index 9b0a5f06..8f9375e6 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plController.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plController.cpp @@ -373,11 +373,11 @@ hsMatrix44Key *plLeafController::GetMatrix44Key(uint32_t i) const void plLeafController::GetKeyTimes(hsTArray &keyTimes) const { - int cIdx; - int kIdx; + int cIdx = 0; + int kIdx = 0; uint32_t stride = GetStride(); uint8_t *keyPtr = (uint8_t *)fKeys; - for (cIdx = 0, kIdx = 0; cIdx < fNumKeys, kIdx < keyTimes.GetCount();) + while (cIdx < fNumKeys && kIdx < keyTimes.GetCount()) { float kTime = keyTimes[kIdx]; float cTime = ((hsKeyFrame*)(keyPtr + cIdx * stride))->fFrame / MAX_FRAMES_PER_SEC;