From 5feccb1babbce13de69b33179a2599e5bc216899 Mon Sep 17 00:00:00 2001 From: Caleb Heydon Date: Tue, 3 Dec 2024 12:35:24 -0500 Subject: [PATCH] [rmodels] Fixed null pointer dereference in LoadGLTF (#4564) * [rmodels] Fixed null pointer dereference in LoadGLTF * [rmodels] Add parenthesis around conditionals in LoadGLTF --- src/rmodels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rmodels.c b/src/rmodels.c index 46309f98..6e33da69 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -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;