Fix T66812: Particles + Build Modifier = Crash

Particles can not be used with a destructive modifiers, so we can not
maker such configuration fully reliable.

Not sure this specific setup ever worked in 2.7x, maybe DM index was
somehow reset somewhere in particle system in older Blender version,
or maybe all of Blender version were crashing.

Anyway, seems to be very easy to avoid obvious index past the array
boundary in the mapping,

Reviewers: brecht, zeddb

Reviewed By: brecht

Maniphest Tasks: T66812

Differential Revision: https://developer.blender.org/D5257
This commit is contained in:
Sergey Sharybin 2019-07-15 14:09:57 +02:00
parent 69aa5bba4f
commit 846e5f1dc0
Notes: blender-bot 2023-02-14 11:28:43 +01:00
Referenced by issue #66812, Particles + Build Modifier = Crash
1 changed files with 1 additions and 1 deletions

View File

@ -1645,7 +1645,7 @@ static int psys_map_index_on_dm(Mesh *mesh,
* to their new location, which means a different index, and for faces
* also a new face interpolation weights */
if (from == PART_FROM_VERT) {
if (index_dmcache == DMCACHE_NOTFOUND || index_dmcache > mesh->totvert) {
if (index_dmcache == DMCACHE_NOTFOUND || index_dmcache >= mesh->totvert) {
return 0;
}