fixed signature-based detection on unknown extensions

pull/3801/head
Krishty 2021-05-05 00:57:43 +02:00
parent b79b84d34e
commit ae93f53b51
1 changed files with 6 additions and 9 deletions

View File

@ -676,8 +676,6 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
if (!imp) {
// not so bad yet ... try format auto detection.
const std::string::size_type s = pFile.find_last_of('.');
if (s != std::string::npos) {
ASSIMP_LOG_INFO("File extension not known, trying signature-based detection");
for( unsigned int a = 0; a < pimpl->mImporter.size(); a++) {
if( pimpl->mImporter[a]->CanRead( pFile, pimpl->mIOHandler, true)) {
@ -686,7 +684,6 @@ const aiScene* Importer::ReadFile( const char* _pFile, unsigned int pFlags) {
break;
}
}
}
// Put a proper error message if no suitable importer was found
if( !imp) {
pimpl->mErrorString = "No suitable reader found for the file format of file \"" + pFile + "\".";