fix [#28336] Particles: setting to zero the count of all elements of a group crashes...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 23 Aug 2011 12:09:20 +0000 (12:09 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 23 Aug 2011 12:09:20 +0000 (12:09 +0000)
source/blender/blenkernel/intern/anim.c

index ebe7325d96ae4041b7d0cad1e4185a9219936599..fcb8da48962db28be26e0c4cc11b96b94737daff 100644 (file)
@@ -1351,6 +1351,10 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
                                continue;
 
                        if(part->ren_as==PART_DRAW_GR) {
+                               /* prevent divide by zero below [#28336] */
+                               if(totgroup == 0)
+                                       continue;
+
                                /* for groups, pick the object based on settings */
                                if(part->draw&PART_DRAW_RAND_GR)
                                        b= BLI_rand() % totgroup;