diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-06 06:37:02 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-08-06 06:37:02 +0400 |
commit | 8d6e5606d88cf1564ba3c0660f10f219eb1f445e (patch) | |
tree | 0a6a2b521e9bf96b6b21066c4114674840e4cb05 /source/blender/blenlib/intern/math_matrix.c | |
parent | 44376a322ff9afb26a6116d5b3e92e10627f23fd (diff) |
Add assert to mul_v3_m3v3 and mul_v2_m3v3,
So they're not likely to be called with bad arguments.
Diffstat (limited to 'source/blender/blenlib/intern/math_matrix.c')
-rw-r--r-- | source/blender/blenlib/intern/math_matrix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 99342c4d6dc..611b3298c38 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -433,6 +433,8 @@ void mul_m4_v4d(float mat[4][4], double r[4]) void mul_v3_m3v3(float r[3], float M[3][3], const float a[3]) { + BLI_assert(r != a); + r[0] = M[0][0] * a[0] + M[1][0] * a[1] + M[2][0] * a[2]; r[1] = M[0][1] * a[0] + M[1][1] * a[1] + M[2][1] * a[2]; r[2] = M[0][2] * a[0] + M[1][2] * a[1] + M[2][2] * a[2]; @@ -440,6 +442,8 @@ void mul_v3_m3v3(float r[3], float M[3][3], const float a[3]) void mul_v2_m3v3(float r[2], float M[3][3], const float a[3]) { + BLI_assert(r != a); + r[0] = M[0][0] * a[0] + M[1][0] * a[1] + M[2][0] * a[2]; r[1] = M[0][1] * a[0] + M[1][1] * a[1] + M[2][1] * a[2]; } |