Kaynağa Gözat

Avoid dereferencing a null pointer in the 'LoadMaterials' function in the models module (#1498)

pull/1500/head
Victor Gallet 5 yıl önce
işlemeyi yapan: GitHub
ebeveyn
işleme
03278a74bf
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. +4
    -1
      src/models.c

+ 4
- 1
src/models.c Dosyayı Görüntüle

@ -948,7 +948,10 @@ Material *LoadMaterials(const char *fileName, int *materialCount)
#endif
// Set materials shader to default (DIFFUSE, SPECULAR, NORMAL)
for (unsigned int i = 0; i < count; i++) materials[i].shader = GetShaderDefault();
if (materials != NULL)
{
for (unsigned int i = 0; i < count; i++) materials[i].shader = GetShaderDefault();
}
*materialCount = count;
return materials;

Yükleniyor…
İptal
Kaydet