diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-10-22 06:03:00 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-10-22 06:03:00 +0300 |
commit | c70650785bffb5f111c3c81c7c37dff4d5a9a446 (patch) | |
tree | 3528fda0f50f0d1d64dd27a2e13b37c4f3ca339c /source | |
parent | 8da55990034e2d5b0a9910583706e4ea99d0f3ce (diff) |
Fix out of bounds array access in mathutils.noise
Regression in 0b2d1badecc48.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/mathutils/mathutils_noise.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c index eece782f6d0..49a3f114ebb 100644 --- a/source/blender/python/mathutils/mathutils_noise.c +++ b/source/blender/python/mathutils/mathutils_noise.c @@ -140,11 +140,11 @@ static void next_state(void) left = N; next = state; - for (j = N - M + 1; j--; p++) { + for (j = N - M + 1; --j; p++) { *p = p[M] ^ TWIST(p[0], p[1]); } - for (j = M; j--; p++) { + for (j = M; --j; p++) { *p = p[M - N] ^ TWIST(p[0], p[1]); } |