Explorar el Código

Merge pull request #3922 from Evangel63/master

Fix bug in aiMetadata constructor that overwrites an array of one of …
Kim Kulling hace 4 años
padre
commit
c04759ccc4
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      include/assimp/metadata.h

+ 4 - 4
include/assimp/metadata.h

@@ -156,7 +156,7 @@ struct aiMetadata {
 
 #ifdef __cplusplus
 
-    /** 
+    /**
      *  @brief  The default constructor, set all members to zero by default.
      */
     aiMetadata() AI_NO_EXCEPT
@@ -202,17 +202,17 @@ struct aiMetadata {
             } break;
             case AI_AISTRING: {
                 aiString v;
-                rhs.Get<aiString>(mKeys[i], v);
+                rhs.Get<aiString>(static_cast<unsigned int>(i), v);
                 mValues[i].mData = new aiString(v);
             } break;
             case AI_AIVECTOR3D: {
                 aiVector3D v;
-                rhs.Get<aiVector3D>(mKeys[i], v);
+                rhs.Get<aiVector3D>(static_cast<unsigned int>(i), v);
                 mValues[i].mData = new aiVector3D(v);
             } break;
             case AI_AIMETADATA: {
                 aiMetadata v;
-                rhs.Get<aiMetadata>(mKeys[i], v);
+                rhs.Get<aiMetadata>(static_cast<unsigned int>(i), v);
                 mValues[i].mData = new aiMetadata(v);
             } break;
 #ifndef SWIG