Commit: 8b3d7f73e349e914dd77955491cd8580688844f4
Author: Kévin Dietrich
Date: Wed Jun 15 19:46:13 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB8b3d7f73e349e914dd77955491cd8580688844f4
Fix crash accessing invalid property headers.
===================================================================
M source/blender/alembic/intern/abc_points.cc
M source/blender/alembic/intern/alembic_capi.cc
===================================================================
diff --git a/source/blender/alembic/intern/abc_points.cc
b/source/blender/alembic/intern/abc_points.cc
index b1102df..db5c545 100644
--- a/source/blender/alembic/intern/abc_points.cc
+++ b/source/blender/alembic/intern/abc_points.cc
@@ -161,12 +161,14 @@ void AbcPointsReader::readObjectData(Main *bmain, Scene
*scene, float time)
utils::mesh_add_verts(mesh, positions->size());
ICompoundProperty prop = m_schema.getArbGeomParams();
-
- const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop, "N",
time);
N3fArraySamplePtr vnormals;
- if (normals_prop) {
- vnormals = normals_prop.getValue(sample_sel);
+ if (prop.valid()) {
+ const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop,
"N", time);
+
+ if (normals_prop) {
+ vnormals = normals_prop.getValue(sample_sel);
+ }
}
read_mverts(mesh->mvert, positions, vnormals);
diff --git a/source/blender/alembic/intern/alembic_capi.cc
b/source/blender/alembic/intern/alembic_capi.cc
index 757daa0..2ed1213 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -708,12 +708,14 @@ static DerivedMesh *read_points_sample(DerivedMesh *dm,
const IObject &iobject,
}
ICompoundProperty prop = schema.getArbGeomParams();
-
- const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop, "N", 0);
N3fArraySamplePtr vnormals;
- if (normals_prop) {
- vnormals = normals_prop.getValue(sample_sel);
+ if (prop.valid()) {
+ const IN3fArrayProperty &normals_prop = IN3fArrayProperty(prop,
"N", 0);
+
+ if (normals_prop) {
+ vnormals = normals_prop.getValue(sample_sel);
+ }
}
MVert *mverts = dm->getVertArray(dm);
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs