[ms3d] Fix assertion failure when file could not be opened.
Check result of IOSystem::Open before constructing stream. Partially addresses #3888.pull/3890/head
parent
7f13387487
commit
1cd3752ec6
|
@ -215,7 +215,12 @@ void MS3DImporter :: CollectChildJoints(const std::vector<TempJoint>& joints, ai
|
||||||
void MS3DImporter::InternReadFile( const std::string& pFile,
|
void MS3DImporter::InternReadFile( const std::string& pFile,
|
||||||
aiScene* pScene, IOSystem* pIOHandler)
|
aiScene* pScene, IOSystem* pIOHandler)
|
||||||
{
|
{
|
||||||
StreamReaderLE stream(pIOHandler->Open(pFile,"rb"));
|
|
||||||
|
auto file = pIOHandler->Open(pFile, "rb");
|
||||||
|
if (!file)
|
||||||
|
throw DeadlyImportError("MS3D: Could not open ", pFile);
|
||||||
|
|
||||||
|
StreamReaderLE stream(file);
|
||||||
|
|
||||||
// CanRead() should have done this already
|
// CanRead() should have done this already
|
||||||
char head[10];
|
char head[10];
|
||||||
|
|
Loading…
Reference in New Issue