more openddl-fixes

pull/3478/head
Kim Kulling 2020-10-26 21:35:44 +01:00
parent 57e691e28e
commit 7e1a8f09c5
3 changed files with 621 additions and 623 deletions

File diff suppressed because it is too large Load Diff

View File

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

View File

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