Restructed copy to avoid pointer artithmetic when only single float is being used to avoid Coverity reported defect.

This commit is contained in:
Robert Osfield 2016-06-20 17:59:52 +01:00
parent 04d387eecf
commit a185c2778f

View File

@ -314,8 +314,8 @@ track_eval_linear(Lib3dsTrack *track, float *value, float t) {
assert(track);
if (!track->nkeys) {
int i;
for (i = 0; i < track->type; ++i) value[i] = 0.0f;
if (track->type==LIB3DS_TRACK_FLOAT) { *value = 0.0f; }
else { for (int i = 0; i < track->type; ++i) value[i] = 0.0f; }
return;
}