Tools
authorKen Hughes <khughes@pacific.edu>
Fri, 3 Aug 2007 21:34:13 +0000 (21:34 +0000)
committerKen Hughes <khughes@pacific.edu>
Fri, 3 Aug 2007 21:34:13 +0000 (21:34 +0000)
-----
Bugfixes for #6816 and #6988: Under Windows, Blender would crash if boolean
operations were done on objects which resulted in an empty mesh.  Problem was
"iterators" created for ConvertCSGDescriptorsToDerivedMesh() tried to access
invalid memory.

intern/bsp/intern/BSP_CSGMesh_CFIterator.h

index 6863bf38cfc0bbdc847a81876d0ec2177f80bca0..010f62159a5d9138292f6854fc82d2d2a4ba8708 100755 (executable)
@@ -125,7 +125,8 @@ BSP_CSGMeshVertexIt_Construct(
        
        BSP_CSGMesh_VertexIt * v_it = new BSP_CSGMesh_VertexIt;
        v_it->mesh = mesh;
-       v_it->pos = &mesh->VertexSet()[0];
+       if( output->num_elements > 0 )
+               v_it->pos = &mesh->VertexSet()[0];
        output->it = v_it;
 };                     
 
@@ -257,11 +258,11 @@ BSP_CSGMesh_FaceIt_Construct(
        
        BSP_CSGMesh_FaceIt * f_it = new BSP_CSGMesh_FaceIt;
        f_it->mesh = mesh;
-       f_it->pos = &mesh->FaceSet()[0];
+       if( output->num_elements > 0 )
+               f_it->pos = &mesh->FaceSet()[0];
        f_it->face_triangle = 0;
 
        output->it = f_it;
-
 };