Alembic import: fix crash when loading invalid mesh

These were just some missing nullptr checks.
This commit is contained in:
Sybren A. Stüvel 2019-07-09 16:57:30 +02:00
parent 817e2796cb
commit b77c01924a
1 changed files with 6 additions and 2 deletions

View File

@ -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(),