Details
Diff Detail
- Repository
- rB Blender
- Branch
- T60261 (branched from master)
- Build Status
Buildable 2707 Build 2707: arc lint + arc unit
Event Timeline
| source/blender/blenkernel/intern/material.c | ||
|---|---|---|
| 1400 | if (ma->nodetree) seems better, no need to lose the node tree if it's there but unused. | |
| 1431 | The same bug exists here. If matcopybuf.nodetree is NULL, then ntreeCopyTree_ex returns an uninitialized variable. To me it seems it's really BKE_id_copy_ex that should be fixed, since I can imagine similar bugs in other places. | |
regarding the handling in BKE_id_copy_ex, I would like to get @Bastien Montagne (mont29) on board...
Indeed behavior of BKE_id_copy_ex was dangerous here, since it accepts NULL source ID, it should ensure returned new copy is properly initialized.
Done in rB0a378b8ebce46
| source/blender/blenkernel/intern/material.c | ||
|---|---|---|
| 1403–1405 | Setting matcopybuf.nodetree = NULL; is redundant, so could be left out. | |
The patch looks fine too. Even if @Bastien Montagne (mont29)'s fix avoids the problem, it's still good not to assume ntreeCopyTree_ex accepts NULL.