[rmodels] Read uninitialized values in GenMeshTangents()
#3998
Labels
help needed - please!
I need help with this issue
GenMeshTangents()
#3998
This commit (c4a51a3) will skip the last iteration if
mesh->vertexCount % 3 == 0
(I suppose this is the normal case), which results in the last values fortan1
andtan2
being uninitialized. In any case this reads uninitialized memory from the end oftan1
andtan2
in the next loop regardless of the value ofmesh->vertexCount
. Did you mean to usei <= mesh->vertexCount - 3
? Maybe a better option would be to assert thatmesh->vertexCount % 3 == 0
and keep the old loop, since otherwise the last 1 or 2 values fromtan1
andtan2
will always be uninitialized, which is probably not what you want.\cc @sgalindo
The text was updated successfully, but these errors were encountered: