Fix crash when 3DS file contains faces but no vertices
parent
f167fe1d4a
commit
c5d048a98a
|
@ -175,6 +175,10 @@ void Discreet3DSImporter::InternReadFile( const std::string& pFile,
|
||||||
// file.
|
// file.
|
||||||
for (std::vector<D3DS::Mesh>::iterator i = mScene->mMeshes.begin(),
|
for (std::vector<D3DS::Mesh>::iterator i = mScene->mMeshes.begin(),
|
||||||
end = mScene->mMeshes.end(); i != end;++i) {
|
end = mScene->mMeshes.end(); i != end;++i) {
|
||||||
|
if ((*i).mFaces.size() > 0 && (*i).mPositions.size() == 0) {
|
||||||
|
delete mScene;
|
||||||
|
throw DeadlyImportError("3DS file contains faces but no vertices: " + pFile);
|
||||||
|
}
|
||||||
CheckIndices(*i);
|
CheckIndices(*i);
|
||||||
MakeUnique (*i);
|
MakeUnique (*i);
|
||||||
ComputeNormalsWithSmoothingsGroups<D3DS::Face>(*i);
|
ComputeNormalsWithSmoothingsGroups<D3DS::Face>(*i);
|
||||||
|
|
Loading…
Reference in New Issue