mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-13 06:48:15 +00:00
Avoid dereferencing a null pointer in the 'LoadMaterials' function in the models module (#1498)
This commit is contained in:
@@ -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;
|
||||||
|
Reference in New Issue
Block a user