Merging r58125 through r58143 from trunk into soc-2013-depsgraph_mt
[blender.git] / source / blender / blenkernel / intern / DerivedMesh.c
index 9260a1063087cc0b6552db7cc1ca19b59ee6472a..731d8f1ab1d0328b911117cff76050e605473308 100644 (file)
@@ -656,21 +656,25 @@ void DM_add_poly_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
 
 void *DM_get_vert_data(DerivedMesh *dm, int index, int type)
 {
+       BLI_assert(index >= 0 && index < dm->getNumVerts(dm));
        return CustomData_get(&dm->vertData, index, type);
 }
 
 void *DM_get_edge_data(DerivedMesh *dm, int index, int type)
 {
+       BLI_assert(index >= 0 && index < dm->getNumEdges(dm));
        return CustomData_get(&dm->edgeData, index, type);
 }
 
 void *DM_get_tessface_data(DerivedMesh *dm, int index, int type)
 {
+       BLI_assert(index >= 0 && index < dm->getNumTessFaces(dm));
        return CustomData_get(&dm->faceData, index, type);
 }
 
 void *DM_get_poly_data(DerivedMesh *dm, int index, int type)
 {
+       BLI_assert(index >= 0 && index < dm->getNumPolys(dm));
        return CustomData_get(&dm->polyData, index, type);
 }