Browse Source

Fix Coverity 1161256

Part of the for loop's condition was being discarded. Changed to while
loop and utilize the correct condition.
Adam Johnson 10 years ago
parent
commit
32d9e5d9e1
  1. 6
      Sources/Plasma/PubUtilLib/plInterp/plController.cpp

6
Sources/Plasma/PubUtilLib/plInterp/plController.cpp

@ -373,11 +373,11 @@ hsMatrix44Key *plLeafController::GetMatrix44Key(uint32_t i) const
void plLeafController::GetKeyTimes(hsTArray<float> &keyTimes) const void plLeafController::GetKeyTimes(hsTArray<float> &keyTimes) const
{ {
int cIdx; int cIdx = 0;
int kIdx; int kIdx = 0;
uint32_t stride = GetStride(); uint32_t stride = GetStride();
uint8_t *keyPtr = (uint8_t *)fKeys; 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 kTime = keyTimes[kIdx];
float cTime = ((hsKeyFrame*)(keyPtr + cIdx * stride))->fFrame / MAX_FRAMES_PER_SEC; float cTime = ((hsKeyFrame*)(keyPtr + cIdx * stride))->fFrame / MAX_FRAMES_PER_SEC;

Loading…
Cancel
Save