Przeglądaj źródła

[rmodels] Read uninitialized values in GenMeshTangents() - fix bounding case (#4066)

* fix

* assert
pull/4074/head
kai-z99 1 rok temu
committed by GitHub
rodzic
commit
a29d334734
Nie znaleziono w bazie danych klucza dla tego podpisu ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 6 dodań i 1 usunięć
  1. +6
    -1
      src/rmodels.c

+ 6
- 1
src/rmodels.c Wyświetl plik

@ -3436,7 +3436,12 @@ void GenMeshTangents(Mesh *mesh)
Vector3 *tan1 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));
Vector3 *tan2 = (Vector3 *)RL_MALLOC(mesh->vertexCount*sizeof(Vector3));
for (int i = 0; i < mesh->vertexCount - 3; i += 3)
if (mesh->vertexCount % 3 != 0)
{
TRACELOG(LOG_WARNING, "MESH: vertexCount expected to be a multiple of 3. Expect uninitialized values.");
}
for (int i = 0; i <= mesh->vertexCount - 3; i += 3)
{
// Get triangle vertices
Vector3 v1 = { mesh->vertices[(i + 0)*3 + 0], mesh->vertices[(i + 0)*3 + 1], mesh->vertices[(i + 0)*3 + 2] };

Ładowanie…
Anuluj
Zapisz