瀏覽代碼

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

pull/1500/head
Victor Gallet 4 年之前
committed by GitHub
父節點
當前提交
03278a74bf
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 4AEE18F83AFDEB23
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. +4
    -1
      src/models.c

+ 4
- 1
src/models.c 查看文件

@ -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;

Loading…
取消
儲存