diff --git a/code/ColladaParser.cpp b/code/ColladaParser.cpp index ec70a0cac..99c74ca62 100644 --- a/code/ColladaParser.cpp +++ b/code/ColladaParser.cpp @@ -246,6 +246,9 @@ void ColladaParser::ReadAssetInfo() // Reads the animation library void ColladaParser::ReadAnimationLibrary() { + if (mReader->isEmptyElement()) { + return; + } while( mReader->read()) { if( mReader->getNodeType() == irr::io::EXN_ELEMENT) @@ -425,6 +428,9 @@ void ColladaParser::ReadAnimationSampler( Collada::AnimationChannel& pChannel) // Reads the skeleton controller library void ColladaParser::ReadControllerLibrary() { + if (mReader->isEmptyElement()) { + return; + } while( mReader->read()) { if( mReader->getNodeType() == irr::io::EXN_ELEMENT) @@ -673,6 +679,9 @@ void ColladaParser::ReadControllerWeights( Collada::Controller& pController) // Reads the image library contents void ColladaParser::ReadImageLibrary() { + if (mReader->isEmptyElement()) { + return; + } while( mReader->read()) { if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { @@ -794,6 +803,9 @@ void ColladaParser::ReadImage( Collada::Image& pImage) // Reads the material library void ColladaParser::ReadMaterialLibrary() { + if (mReader->isEmptyElement()) { + return; + } while( mReader->read()) { if( mReader->getNodeType() == irr::io::EXN_ELEMENT) @@ -826,6 +838,9 @@ void ColladaParser::ReadMaterialLibrary() // Reads the light library void ColladaParser::ReadLightLibrary() { + if (mReader->isEmptyElement()) { + return; + } while( mReader->read()) { if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { @@ -857,6 +872,9 @@ void ColladaParser::ReadLightLibrary() // Reads the camera library void ColladaParser::ReadCameraLibrary() { + if (mReader->isEmptyElement()) { + return; + } while( mReader->read()) { if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { @@ -1043,6 +1061,10 @@ void ColladaParser::ReadCamera( Collada::Camera& pCamera) // Reads the effect library void ColladaParser::ReadEffectLibrary() { + if (mReader->isEmptyElement()) { + return; + } + while( mReader->read()) { if( mReader->getNodeType() == irr::io::EXN_ELEMENT) { @@ -1195,8 +1217,9 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect) // Read texture wrapping + UV transform settings from a profile==Maya chunk void ColladaParser::ReadSamplerProperties( Sampler& out ) { - if (mReader->isEmptyElement()) + if (mReader->isEmptyElement()) { return; + } while( mReader->read()) { diff --git a/test/models/Collada/cube_emptyTags.dae b/test/models/Collada/cube_emptyTags.dae new file mode 100644 index 000000000..063777e5f --- /dev/null +++ b/test/models/Collada/cube_emptyTags.dae @@ -0,0 +1,90 @@ + + + + + + + + + + + + -50 50 50 50 50 50 -50 -50 50 50 -50 50 -50 50 -50 50 50 -50 -50 -50 -50 50 -50 -50 + + + + + + + + + + 0 0 1 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 0 1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 -1 0 0 -1 0 0 -1 0 0 -1 + + + + + + + + + + + + + + + 4 4 4 4 4 4 +

0 0 2 1 3 2 1 3 0 4 1 5 5 6 4 7 6 8 7 9 3 10 2 11 0 12 4 13 6 14 2 15 3 16 7 17 5 18 1 19 5 20 7 21 6 22 4 23

+
+
+
+
+ + + + -427.749 333.855 655.017 + 0 1 0 -33 + 1 0 0 -22.1954 + 0 0 1 0 + + + + -500 1000 400 + 0 0 1 0 + 0 1 0 0 + 1 0 0 0 + + + + 0 0 1 0 + 0 1 0 0 + 1 0 0 0 + + + + + + + + + + -427.749 333.855 655.017 + 0 1 0 -33 + 1 0 0 -22.1954 + 0 0 1 0 + + + + 3 4 10 + 0 0 1 0 + 0 1 0 0 + 1 0 0 0 + + + + + + + +