closes https://github.com/assimp/assimp/issues/1320: check if all
authorKim Kulling <kim.kulling@googlemail.com>
Wed, 28 Jun 2017 20:13:49 +0000 (22:13 +0200)
committerKim Kulling <kim.kulling@googlemail.com>
Wed, 28 Jun 2017 20:13:49 +0000 (22:13 +0200)
exporters are disabled.

code/Exporter.cpp

index bae4d7f..f037028 100644 (file)
@@ -172,8 +172,10 @@ public:
         GetPostProcessingStepInstanceList(mPostProcessingSteps);
 
         // grab all built-in exporters
-        mExporters.resize(ASSIMP_NUM_EXPORTERS);
-        std::copy(gExporters,gExporters+ASSIMP_NUM_EXPORTERS,mExporters.begin());
+        if ( 0 != ( ASSIMP_NUM_EXPORTERS ) ) {
+            mExporters.resize( ASSIMP_NUM_EXPORTERS );
+            std::copy( gExporters, gExporters + ASSIMP_NUM_EXPORTERS, mExporters.begin() );
+        }
     }
 
     ~ExporterPimpl()
@@ -187,7 +189,6 @@ public:
     }
 
 public:
-
     aiExportDataBlob* blob;
     std::shared_ptr< Assimp::IOSystem > mIOSystem;
     bool mIsDefaultIOHandler;
@@ -408,6 +409,7 @@ aiReturn Exporter::Export( const aiScene* pScene, const char* pFormatId, const c
 
     pimpl->mError = std::string("Found no exporter to handle this file format: ") + pFormatId;
     ASSIMP_END_EXCEPTION_REGION(aiReturn);
+    
     return AI_FAILURE;
 }
 
@@ -492,7 +494,6 @@ ExportProperties::ExportProperties(const ExportProperties &other)
     // empty
 }
 
-
 // ------------------------------------------------------------------------------------------------
 // Set a configuration property
 bool ExportProperties::SetPropertyInteger(const char* szName, int iValue) {