浏览代码

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 密钥 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 #endif
// Set materials shader to default (DIFFUSE, SPECULAR, NORMAL) // 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; *materialCount = count;
return materials; return materials;

正在加载...
取消
保存