Coverity-findings

This commit is contained in:
Kim Kulling
2018-12-27 22:28:23 +01:00
parent 9c78a43fbe
commit 4c6db68d34
5 changed files with 36 additions and 17 deletions

View File

@@ -731,11 +731,10 @@ unsigned int XGLImporter::ResolveMaterialRef(TempScope& scope)
}
// ------------------------------------------------------------------------------------------------
void XGLImporter::ReadMaterial(TempScope& scope)
{
void XGLImporter::ReadMaterial(TempScope& scope) {
const unsigned int mat_id = ReadIDAttr();
std::unique_ptr<aiMaterial> mat(new aiMaterial());
aiMaterial *mat(new aiMaterial );
while (ReadElementUpToClosing("mat")) {
const std::string& s = GetElementName();
if (s == "amb") {
@@ -764,11 +763,10 @@ void XGLImporter::ReadMaterial(TempScope& scope)
}
}
scope.materials[mat_id] = mat.get();
scope.materials_linear.push_back(mat.release());
scope.materials[mat_id] = mat;
scope.materials_linear.push_back(mat);
}
// ----------------------------------------------------------------------------------------------
void XGLImporter::ReadFaceVertex(const TempMesh& t, TempFace& out)
{