Skip to content

Commit

Permalink
[rmodels] Fixed null pointer dereference in LoadGLTF (#4564)
Browse files Browse the repository at this point in the history
* [rmodels] Fixed null pointer dereference in LoadGLTF

* [rmodels] Add parenthesis around conditionals in LoadGLTF
  • Loading branch information
CalebHeydon authored Dec 3, 2024
1 parent 1f0325b commit 5feccb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rmodels.c
Original file line number Diff line number Diff line change
Expand Up @@ -5657,7 +5657,7 @@ static Model LoadGLTF(const char *fileName)
}

// Load primitive indices data (if provided)
if (mesh->primitives[p].indices != NULL)
if ((mesh->primitives[p].indices != NULL) && (mesh->primitives[p].indices->buffer_view != NULL))
{
cgltf_accessor *attribute = mesh->primitives[p].indices;

Expand Down

0 comments on commit 5feccb1

Please sign in to comment.