Quellcode durchsuchen

[rmodels] Fix null pointer dereference in LoadImageFromCgltfImage (#4557)

pull/4561/head
Caleb Heydon vor 2 Wochen
committed von GitHub
Ursprung
Commit
9047630ae7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden GPG-Schlüssel-ID: B5690EEEBB952194
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. +1
    -1
      src/rmodels.c

+ 1
- 1
src/rmodels.c Datei anzeigen

@ -5110,7 +5110,7 @@ static Image LoadImageFromCgltfImage(cgltf_image *cgltfImage, const char *texPat
image = LoadImage(TextFormat("%s/%s", texPath, cgltfImage->uri));
}
}
else if (cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer
else if (cgltfImage->buffer_view != NULL && cgltfImage->buffer_view->buffer->data != NULL) // Check if image is provided as data buffer
{
unsigned char *data = RL_MALLOC(cgltfImage->buffer_view->size);
int offset = (int)cgltfImage->buffer_view->offset;

Laden…
Abbrechen
Speichern