Fix crash when 3DS file contains faces but no vertices

pull/450/head
Turo Lamminen 2015-01-26 12:38:30 +02:00
parent f167fe1d4a
commit c5d048a98a
1 changed files with 4 additions and 0 deletions

View File

@ -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);