diff --git a/code/ColladaLoader.cpp b/code/ColladaLoader.cpp index ffb1a3df4..78ae57405 100644 --- a/code/ColladaLoader.cpp +++ b/code/ColladaLoader.cpp @@ -1270,15 +1270,16 @@ const aiString& ColladaLoader::FindFilenameForEffectTexture( const ColladaParser // if this is an embedded texture image setup an aiTexture for it if (imIt->second.mFileName.empty()) { - if (imIt->second.mImageData.empty()) + if (imIt->second.mImageData.empty()) { throw new ImportErrorException("Collada: Invalid texture, no data or file reference given"); + } aiTexture* tex = new aiTexture(); // setup format hint - if (imIt->second.mEmbeddedFormat.length() > 3) + if (imIt->second.mEmbeddedFormat.length() > 3) { DefaultLogger::get()->warn("Collada: texture format hint is too long, truncating to 3 characters"); - + } strncpy(tex->achFormatHint,imIt->second.mEmbeddedFormat.c_str(),3); // and copy texture data diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index 17bdf0e72..58af57cf2 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -704,10 +704,16 @@ void ColladaParser::ReadImage( Collada::Image& pImage) { if (mFormat == FV_1_4_n) { - // element content is filename - hopefully - const char* sz = TestTextContent(); - if (sz)pImage.mFileName = sz; - TestClosing( "init_from"); + // FIX: C4D exporter writes empty tags + if (!mReader->isEmptyElement()) { + // element content is filename - hopefully + const char* sz = TestTextContent(); + if (sz)pImage.mFileName = sz; + TestClosing( "init_from"); + } + if (!pImage.mFileName.length()) { + pImage.mFileName = "unknown_texture"; + } } else if (mFormat == FV_1_5_n) { diff --git a/code/MD5Parser.cpp b/code/MD5Parser.cpp index 58adb8e9e..29c4a9ed5 100644 --- a/code/MD5Parser.cpp +++ b/code/MD5Parser.cpp @@ -61,7 +61,7 @@ MD5Parser::MD5Parser(char* _buffer, unsigned int /*_fileSize*/ ) ai_assert(NULL != _buffer && 0 != _fileSize); buffer = _buffer; - fileSize = fileSize; + fileSize = _fileSize; lineNumber = 0; DefaultLogger::get()->debug("MD5Parser begin");