Browse Source

more openddl-fixes

Kim Kulling 5 years ago
parent
commit
7e1a8f09c5

File diff suppressed because it is too large
+ 408 - 413
code/AssetLib/OpenGEX/OpenGEXImporter.cpp


+ 5 - 2
contrib/openddlparser/code/OpenDDLParser.cpp

@@ -100,7 +100,7 @@ static bool isUnsignedIntegerType(Value::ValueType integerType) {
 }
 
 static DDLNode *createDDLNode(Text *id, OpenDDLParser *parser) {
-    if (nullptr == id || nullptr == parser) {
+    if (nullptr == id || nullptr == parser || id->m_buffer == nullptr) {
         return nullptr;
     }
 
@@ -543,6 +543,9 @@ char *OpenDDLParser::parseIdentifier(char *in, char *end, Text **id) {
 
     // ignore blanks
     in = lookForNextToken(in, end);
+    if (in == end) {
+        return in;
+    }
 
     // staring with a number is forbidden
     if (isNumeric<const char>(*in)) {
@@ -861,7 +864,7 @@ char *OpenDDLParser::parseProperty(char *in, char *end, Property **prop) {
     }
 
     in = lookForNextToken(in, end);
-    Text *id(nullptr);
+    Text *id = nullptr;
     in = parseIdentifier(in, end, &id);
     if (nullptr != id) {
         in = lookForNextToken(in, end);

+ 1 - 1
test/unit/utOpenGEXImportExport.cpp

@@ -48,7 +48,7 @@ using namespace Assimp;
 
 class utOpenGEXImportExport : public AbstractImportExportBase {
 public:
-    virtual bool importerTest() {
+    bool importerTest() override {
         Assimp::Importer importer;
         const aiScene *scene = importer.ReadFile(ASSIMP_TEST_MODELS_DIR "/OpenGEX/Example.ogex", 0);
         return nullptr != scene;

Some files were not shown because too many files changed in this diff