Bugfix: crash with strand surface AAO and layer ipo's.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 3 Apr 2008 00:40:53 +0000 (00:40 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 3 Apr 2008 00:40:53 +0000 (00:40 +0000)
source/blender/render/intern/source/occlusion.c

index a4d75c032e5a49dd5545faf9fb1e5649ccbf7f0d..d70c51b83bc3952680c16a68c0f6c9fd0be04d0f 100644 (file)
@@ -1475,7 +1475,7 @@ static void sample_occ_surface(ShadeInput *shi)
        int *face, *index = RE_strandren_get_face(shi->obr, strand, 0);
        float w[4], *co1, *co2, *co3, *co4;
 
-       if(mesh && index) {
+       if(mesh && mesh->face && mesh->co && mesh->col && index) {
                face= mesh->face[*index];
 
                co1= mesh->co[face[0]];
@@ -1555,6 +1555,9 @@ void make_occ_tree(Render *re)
                        occ_compute_passes(re, re->occlusiontree, re->wrld.ao_approx_passes);
 
                for(mesh=re->strandsurface.first; mesh; mesh=mesh->next) {
+                       if(!mesh->face || !mesh->co || !mesh->col)
+                               continue;
+
                        count= MEM_callocN(sizeof(int)*mesh->totvert, "OcclusionCount");
                        facecol= MEM_callocN(sizeof(float)*3*mesh->totface, "StrandSurfFaceCol");