Revision: 25360
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25360
Author:   blendix
Date:     2009-12-14 14:11:22 +0100 (Mon, 14 Dec 2009)

Log Message:
-----------
Fix #20372: crash when strand render enabled with child hairs.

Modified Paths:
--------------
    trunk/blender/source/blender/render/intern/source/convertblender.c

Modified: trunk/blender/source/blender/render/intern/source/convertblender.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/convertblender.c  
2009-12-14 12:09:20 UTC (rev 25359)
+++ trunk/blender/source/blender/render/intern/source/convertblender.c  
2009-12-14 13:11:22 UTC (rev 25360)
@@ -1707,14 +1707,8 @@
 
                        totface= psmd->dm->getNumFaces(psmd->dm);
                        origindex= psmd->dm->getFaceDataArray(psmd->dm, 
CD_ORIGINDEX);
-                       if(origindex) {
-                               for(a=0; a<totface; a++)
-                                       strandbuf->totbound= 
MAX2(strandbuf->totbound, origindex[a]);
-                       }
-                       else {
-                               for(a=0; a<totface; a++)
-                                       strandbuf->totbound= 
MAX2(strandbuf->totbound, a);
-                       }
+                       for(a=0; a<totface; a++)
+                               strandbuf->totbound= MAX2(strandbuf->totbound, 
(origindex)? origindex[a]: a);
 
                        strandbuf->totbound++;
                        strandbuf->bound= 
MEM_callocN(sizeof(StrandBound)*strandbuf->totbound, "StrandBound");
@@ -1856,8 +1850,10 @@
                        dosimplify = psys_render_simplify_params(psys, cpa, 
simplify);
 
                        if(strandbuf) {
-                               if(origindex[cpa->num]+1 > sbound - 
strandbuf->bound) {
-                                       sbound= strandbuf->bound + 
origindex[cpa->num]+1;
+                               int orignum= (origindex)? origindex[cpa->num]: 
cpa->num;
+
+                               if(orignum > sbound - strandbuf->bound) {
+                                       sbound= strandbuf->bound + orignum;
                                        sbound->start= sbound->end= 
obr->totstrand;
                                }
                        }


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to