Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-07-13 00:35:10 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-13 00:35:10 +0400
commit64091ff5bd6258cd05cf4b1d96da22cb3aef6976 (patch)
tree8cbe0452b3536ab92781b06b748da6616509920b /source
parentaf06e281c03edf96c53ba67ea96e587ca9fd92f6 (diff)
fix for crash when psys_get_dupli_texture() was called on a subsurf mesh with simplify enabled.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/particle.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index f33ac2ad380..96c0afedfb0 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -4257,8 +4257,13 @@ void psys_get_dupli_texture(Object *ob, ParticleSettings *part, ParticleSystemMo
num= pa->num_dmcache;
if(num == DMCACHE_NOTFOUND)
- if(pa->num < psmd->dm->getNumFaces(psmd->dm))
- num= pa->num;
+ num= pa->num;
+
+ if (num >= psmd->dm->getNumFaces(psmd->dm)) {
+ /* happens when simplify is enabled
+ * gives invalid coords but would crash otherwise */
+ num= DMCACHE_NOTFOUND;
+ }
if(mtface && num != DMCACHE_NOTFOUND) {
mface= psmd->dm->getFaceData(psmd->dm, num, CD_MFACE);