From 88a7e24d44695f49e1250a9314f03bf4c6e1cff8 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Sun, 24 Jun 2012 18:55:14 +0000 Subject: A few PVS studio things --- Stars45/ShipDesign.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Stars45/ShipDesign.cpp') diff --git a/Stars45/ShipDesign.cpp b/Stars45/ShipDesign.cpp index 9965d3d..92a5c30 100644 --- a/Stars45/ShipDesign.cpp +++ b/Stars45/ShipDesign.cpp @@ -3590,6 +3590,8 @@ void ShipDesign::ParseSkinMtl(TermStruct* val, Skin* skin) { Material* mtl = new(__FILE__,__LINE__) Material; + if (mtl == nullptr) + return; for (int i = 0; i < val->elements()->size(); i++) { TermDef* def = val->elements()->at(i)->isDef(); @@ -3675,6 +3677,7 @@ ShipDesign::ParseSkinMtl(TermStruct* val, Skin* skin) Print("WARNING: invalid or missing tex_emissive in '%s'\n", filename); DataLoader* loader = DataLoader::GetLoader(); + loader->LoadTexture(tex_name, mtl->tex_emissive); } } -- cgit v1.1