[Bf-blender-cvs] [a29283f43a6] blender-v2.93-release: Fix T93117: Texture paint clone tool crash in certain situation

Philipp Oeser noreply at git.blender.org
Sun Nov 28 17:23:31 CET 2021


Commit: a29283f43a6933726ed10ffaa3821241b219261a
Author: Philipp Oeser
Date:   Fri Nov 26 10:00:09 2021 +0100
Branches: blender-v2.93-release
https://developer.blender.org/rBa29283f43a6933726ed10ffaa3821241b219261a

Fix T93117: Texture paint clone tool crash in certain situation

Caused by {rBaf162658e127}, so long standing bug.

When changing clone slots (report involved a quite complicated sequence
of selecting textures and undo -- but I think this could happen in more
situations) code checks for UV of new clone slot.
However, since above commit the slot and the clone slot were mixed up,
so in this case the responsible NULL check (for when no UV is assigned)
wasnt working.
Now correct this (NULL check the clone slot uv -- instead of the paint
slot UV).

note: not sure why low level CustomData functions actually dont do the
name NULL checks themselves (seems like callers are always responsible).

Maniphest Tasks: T93117

Differential Revision: https://developer.blender.org/D13378

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_proj.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 8be635085ff..dd063589b5a 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4128,8 +4128,9 @@ static bool project_paint_clone_face_skip(ProjPaintState *ps,
 
     if (ps->do_material_slots) {
       if (lc->slot_clone != lc->slot_last_clone) {
-        if (!slot->uvname || !(lc->mloopuv_clone_base = CustomData_get_layer_named(
-                                   &ps->me_eval->ldata, CD_MLOOPUV, lc->slot_clone->uvname))) {
+        if (!lc->slot_clone->uvname ||
+            !(lc->mloopuv_clone_base = CustomData_get_layer_named(
+                  &ps->me_eval->ldata, CD_MLOOPUV, lc->slot_clone->uvname))) {
           lc->mloopuv_clone_base = CustomData_get_layer(&ps->me_eval->ldata, CD_MLOOPUV);
         }
         lc->slot_last_clone = lc->slot_clone;



More information about the Bf-blender-cvs mailing list