[3ds] Fix assertion failure when file could not be opened
Check result of IOSystem::Open before constructing stream. Partially addresses #3888.pull/3890/head
parent
785cca1bb4
commit
116ebf6e10
|
@ -143,7 +143,13 @@ void Discreet3DSImporter::SetupProperties(const Importer * /*pImp*/) {
|
|||
// Imports the given file into the given scene structure.
|
||||
void Discreet3DSImporter::InternReadFile(const std::string &pFile,
|
||||
aiScene *pScene, IOSystem *pIOHandler) {
|
||||
StreamReaderLE theStream(pIOHandler->Open(pFile, "rb"));
|
||||
|
||||
auto theFile = pIOHandler->Open(pFile, "rb");
|
||||
if (!theFile) {
|
||||
throw DeadlyImportError("3DS: Could not open ", pFile);
|
||||
}
|
||||
|
||||
StreamReaderLE theStream(theFile);
|
||||
|
||||
// We should have at least one chunk
|
||||
if (theStream.GetRemainingSize() < 16) {
|
||||
|
|
Loading…
Reference in New Issue