Ensure that the aiString lenght is 4 bytes independent which platform and add mingw back to appveyor.
This commit is contained in:
@@ -545,23 +545,7 @@ aiReturn aiMaterial::AddProperty (const aiString* pInput,
|
||||
unsigned int type,
|
||||
unsigned int index)
|
||||
{
|
||||
// We don't want to add the whole buffer .. write a 32 bit length
|
||||
// prefix followed by the zero-terminated UTF8 string.
|
||||
// (HACK) I don't want to break the ABI now, but we definitely
|
||||
// ought to change aiString::mLength to uint32_t one day.
|
||||
if (sizeof(size_t) == 8) {
|
||||
aiString copy = *pInput;
|
||||
uint32_t* s = reinterpret_cast<uint32_t*>(©.length);
|
||||
s[1] = static_cast<uint32_t>(pInput->length);
|
||||
|
||||
return AddBinaryProperty(s+1,
|
||||
static_cast<unsigned int>(pInput->length+1+4),
|
||||
pKey,
|
||||
type,
|
||||
index,
|
||||
aiPTI_String);
|
||||
}
|
||||
ai_assert(sizeof(size_t)==4);
|
||||
ai_assert(sizeof(ai_uint32)==4);
|
||||
return AddBinaryProperty(pInput,
|
||||
static_cast<unsigned int>(pInput->length+1+4),
|
||||
pKey,
|
||||
|
||||
@@ -266,7 +266,7 @@ void glTFImporter::ImportMeshes(glTF::Asset& r)
|
||||
|
||||
aim->mName = mesh.id;
|
||||
if (mesh.primitives.size() > 1) {
|
||||
size_t& len = aim->mName.length;
|
||||
ai_uint32& len = aim->mName.length;
|
||||
aim->mName.data[len] = '-';
|
||||
len += 1 + ASSIMP_itoa10(aim->mName.data + len + 1, unsigned(MAXLEN - len - 1), p);
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ void glTF2Importer::ImportMeshes(glTF2::Asset& r)
|
||||
aim->mName = mesh.name.empty() ? mesh.id : mesh.name;
|
||||
|
||||
if (mesh.primitives.size() > 1) {
|
||||
size_t& len = aim->mName.length;
|
||||
ai_uint32& len = aim->mName.length;
|
||||
aim->mName.data[len] = '-';
|
||||
len += 1 + ASSIMP_itoa10(aim->mName.data + len + 1, unsigned(MAXLEN - len - 1), p);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user