diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-07-09 17:57:30 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-07-09 18:39:02 +0300 |
commit | b77c01924ab8ee01ecec8188de644f3b76072b6f (patch) | |
tree | f2df67651f4c1fc08f7b9328b6438f4b00e7026c /source/blender/alembic | |
parent | 817e2796cbe4c6e115c8a4b6bf535017043be930 (diff) |
Alembic import: fix crash when loading invalid mesh
These were just some missing nullptr checks.
Diffstat (limited to 'source/blender/alembic')
-rw-r--r-- | source/blender/alembic/intern/abc_mesh.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 0ff3360d644..b0129a358ec 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -1122,7 +1122,9 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh, sample = m_schema.getValue(sample_sel); } catch (Alembic::Util::Exception &ex) { - *err_str = "Error reading mesh sample; more detail on the console"; + if (err_str != nullptr) { + *err_str = "Error reading mesh sample; more detail on the console"; + } printf("Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n", m_iobject.getFullName().c_str(), m_schema.getName().c_str(), @@ -1417,7 +1419,9 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh, sample = m_schema.getValue(sample_sel); } catch (Alembic::Util::Exception &ex) { - *err_str = "Error reading mesh sample; more detail on the console"; + if (err_str != nullptr) { + *err_str = "Error reading mesh sample; more detail on the console"; + } printf("Alembic: error reading mesh sample for '%s/%s' at time %f: %s\n", m_iobject.getFullName().c_str(), m_schema.getName().c_str(), |