From ebc03be3accaab10df542f0b541700b9ca83b5c5 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Sat, 13 Mar 2010 12:59:50 +0000 Subject: [PATCH] Fix usage of AI_MATKEY_UVTRANSFORM in LWO loader. The buffer was incorrectly dimensioned, random data got pulled into the material key's data section. This fixes a few failures in the regression testing suite. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@603 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- code/LWOMaterial.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/LWOMaterial.cpp b/code/LWOMaterial.cpp index f025ad6a7..dfb38dbbf 100644 --- a/code/LWOMaterial.cpp +++ b/code/LWOMaterial.cpp @@ -157,7 +157,8 @@ bool LWOImporter::HandleTextures(MaterialHelper* pcMat, const TextureList& in, a trafo.mScaling.x = (*it).wrapAmountW; trafo.mScaling.y = (*it).wrapAmountH; - pcMat->AddProperty((float*)&trafo,sizeof(aiUVTransform),AI_MATKEY_UVTRANSFORM(type,cur)); + BOOST_STATIC_ASSERT(sizeof(aiUVTransform)/sizeof(float) == 5); + pcMat->AddProperty((float*)&trafo,5,AI_MATKEY_UVTRANSFORM(type,cur)); } DefaultLogger::get()->debug("LWO2: Setting up non-UV mapping"); }