From bcdec635700b22e7d87756d8ea682e2d5c64032b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 22 Jun 2018 12:07:48 +0200 Subject: Fix harmless use of unintialized memory Still nbice to avoid such access to keep valgrind output more sane. --- source/blender/blenkernel/intern/shrinkwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index c93e964c5ee..3db03c3f085 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -357,7 +357,7 @@ static void shrinkwrap_calc_normal_projection_cb_ex( /* don't set the initial dist (which is more efficient), * because its calculated in the targets space, we want the dist in our own space */ if (proj_limit_squared != 0.0f) { - if (len_squared_v3v3(hit->co, co) > proj_limit_squared) { + if (hit->index != -1 && len_squared_v3v3(hit->co, co) > proj_limit_squared) { hit->index = -1; } } -- cgit v1.2.3