1
0
Fork 0

#587: don't crash on negative sizes

(see simgear commit)
This commit is contained in:
ThorstenB 2012-01-09 20:29:51 +01:00
parent 699f4eeb38
commit e82c36d76b

View file

@ -157,7 +157,7 @@ naRef makeVectorFromVec(naContext c, const T& vec)
const int num_components const int num_components
= sizeof(vec.data()) / sizeof(typename T::value_type); = sizeof(vec.data()) / sizeof(typename T::value_type);
naRef vector = naNewVector(c); naRef vector = naNewVector(c);
naVec_setsize(vector, num_components); naVec_setsize(c, vector, num_components);
for (int i = 0; i < num_components; ++i) for (int i = 0; i < num_components; ++i)
naVec_set(vector, i, naNum(vec[i])); naVec_set(vector, i, naNum(vec[i]));
return vector; return vector;