Merge pull request #38 from Hecklezz/master

[FIRE-34363] Fixed unwanted implicit cast of U32 to U16 causing a crash
meow-7.2.2
Ansariel Hiller 2024-08-05 17:16:40 +02:00 committed by GitHub
commit efd4ff3819
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -987,7 +987,7 @@ LLTerrainPartition::LLTerrainPartition(LLViewerRegion* regionp)
}
// Do not add vertices; honor strict vertex count specified by strider_vertex_count
void gen_terrain_tangents(U16 strider_vertex_count,
void gen_terrain_tangents(U32 strider_vertex_count, // <FS/> [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash
U32 strider_index_count,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
@ -1003,7 +1003,7 @@ void gen_terrain_tangents(U16 strider_vertex_count,
std::vector<LLVector2> texcoords(strider_vertex_count);
std::vector<U16> indices(strider_index_count);
for (U16 v = 0; v < strider_vertex_count; ++v)
for (U32 v = 0; v < strider_vertex_count; ++v) // <FS/> [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash
{
F32 *vert = verticesp[v].mV;
vertices[v] = LLVector4a(vert[0], vert[1], vert[2], 1.f);
@ -1019,7 +1019,7 @@ void gen_terrain_tangents(U16 strider_vertex_count,
LLCalculateTangentArray(strider_vertex_count, vertices, normals, texcoords.data(), strider_index_count / 3, indices.data(), tangents);
for (U16 v = 0; v < strider_vertex_count; ++v)
for (U32 v = 0; v < strider_vertex_count; ++v) // <FS/> [FIRE-34363] Fix implicit cast from U32->U16 that can cause a crash
{
tangentsp[v] = tangents[v];
}