From f3f5f38c0f4d982eb299f7b582b8b04b038f212a Mon Sep 17 00:00:00 2001 From: Caleb Heydon Date: Mon, 2 Dec 2024 07:35:54 -0500 Subject: [PATCH] [rmodels] Fix crash when NULL is passed to LoadImageFromCgltfImage (#4563) --- src/rmodels.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rmodels.c b/src/rmodels.c index 5e6d3966..46309f98 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -5060,6 +5060,8 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat { Image image = { 0 }; + if (cgltfImage == NULL) return image; + if (cgltfImage->uri != NULL) // Check if image data is provided as an uri (base64 or path) { if ((strlen(cgltfImage->uri) > 5) &&