Fix T62236: Crash texture painting
authorCampbell Barton <ideasman42@gmail.com>
Wed, 6 Mar 2019 05:47:02 +0000 (16:47 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 6 Mar 2019 05:54:07 +0000 (16:54 +1100)
Caused by 10d9a2494fc5e which removed 5x length clamping.

source/blender/editors/sculpt_paint/paint_image_proj.c

index 1b5f0ca..6da33ad 100644 (file)
@@ -1322,6 +1322,9 @@ static void uv_image_outset(
                        len_fact = cosf(tri_ang);
                        len_fact = UNLIKELY(len_fact < FLT_EPSILON) ? FLT_MAX : (1.0f / len_fact);
 
+                       /* Clamp the length factor, see: T62236. */
+                       len_fact = MIN2(len_fact, 5.0f);
+
                        mul_v2_fl(no, ps->seam_bleed_px * len_fact);
 
                        add_v2_v2v2(seam_data->seam_puvs[i], puv[fidx[i]], no);