2
0
Эх сурвалжийг харах

Update glTF2Asset.inl

Fix possible nullptr-dereferencing.
Kim Kulling 6 жил өмнө
parent
commit
657014dff6
1 өөрчлөгдсөн 5 нэмэгдсэн , 3 устгасан
  1. 5 3
      code/glTF2Asset.inl

+ 5 - 3
code/glTF2Asset.inl

@@ -1359,9 +1359,11 @@ inline void Asset::Load(const std::string& pFile, bool isBinary)
 
     // Force reading of skins since they're not always directly referenced
     if (Value* skinsArray = FindArray(doc, "skins")) {
-        for (unsigned int i = 0; i < skinsArray->Size(); ++i) {
-            skins.Retrieve(i);
-        }
+        if ( nullptr != skinsArray ) {
+                for (unsigned int i = 0; i < skinsArray->Size(); ++i) {
+                    skins.Retrieve(i);
+                }
+	}
     }
 
     if (Value* animsArray = FindArray(doc, "animations")) {