]> git.mxchange.org Git - flightgear.git/commitdiff
#587: don't crash on negative sizes
authorThorstenB <brehmt@gmail.com>
Mon, 9 Jan 2012 19:29:51 +0000 (20:29 +0100)
committerThorstenB <brehmt@gmail.com>
Mon, 9 Jan 2012 19:29:51 +0000 (20:29 +0100)
(see simgear commit)

src/Scripting/nasal-props.cxx

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