Fix strict aliasing violation in MaterialSystem

pull/1992/head
Turo Lamminen 2018-06-01 12:20:16 +03:00
parent 6aa32b41a1
commit bbb60c29f0
1 changed files with 3 additions and 2 deletions

View File

@ -354,8 +354,9 @@ aiReturn aiGetMaterialTexture(const C_STRUCT aiMaterial* mat,
return AI_FAILURE;
}
// Determine mapping type
aiTextureMapping mapping = aiTextureMapping_UV;
aiGetMaterialInteger(mat,AI_MATKEY_MAPPING(type,index),(int*)&mapping);
int mapping_ = static_cast<int>(aiTextureMapping_UV);
aiGetMaterialInteger(mat,AI_MATKEY_MAPPING(type,index), &mapping_);
aiTextureMapping mapping = static_cast<aiTextureMapping>(mapping_);
if (_mapping)
*_mapping = mapping;