Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-11-14 10:42:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-14 10:42:14 +0300
commit4a3e00488d27b4a568de4fdaa44b076b24c04abd (patch)
tree8bb2cf5b20e405a631ba7da9fe9ad3bb2b01747e /source/blender/python
parent6a49aca15327d6bdc60458529dd4dd5f2e33ba79 (diff)
fix for own recent error, [#24695] column_vector_multiplication call writes past end of array
was setting the vector array out of bounds with vec*=matrix, where the vector wasnt size 4.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/mathutils_vector.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_vector.c
index 64f7eb6634b..e4027d7a80e 100644
--- a/source/blender/python/generic/mathutils_vector.c
+++ b/source/blender/python/generic/mathutils_vector.c
@@ -1145,11 +1145,14 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2)
/* only support vec*=float and vec*=mat
vec*=vec result is a float so that wont work */
if (MatrixObject_Check(v2)) {
+ float rvec[MAX_DIMENSIONS];
if(!BaseMath_ReadCallback((MatrixObject *)v2))
return NULL;
- if(column_vector_multiplication(vec->vec, vec, (MatrixObject*)v2) == -1)
+ if(column_vector_multiplication(rvec, vec, (MatrixObject*)v2) == -1)
return NULL;
+
+ memcpy(vec->vec, rvec, sizeof(float) * vec->size);
}
else if (QuaternionObject_Check(v2)) {
/* VEC *= QUAT */