diff options
| author | raysan5 <raysan5@gmail.com> | 2014-12-17 19:32:54 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2014-12-17 19:32:54 +0100 |
| commit | db1ad74ef21dbe48fafc3afc9ba6751832f22b77 (patch) | |
| tree | 0740e25078409f247e4933691895ab9fd097568e | |
| parent | 2e5f58255a391323fef54afc895a1d5a8ba06344 (diff) | |
| download | raylib-db1ad74ef21dbe48fafc3afc9ba6751832f22b77.tar.gz raylib-db1ad74ef21dbe48fafc3afc9ba6751832f22b77.zip | |
[models] file open error check
| -rw-r--r-- | src/models.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/models.c b/src/models.c index 1ae95f23..539af3f9 100644 --- a/src/models.c +++ b/src/models.c @@ -1290,6 +1290,12 @@ static VertexData LoadOBJ(const char *fileName) FILE *objFile; objFile = fopen(fileName, "rt"); + + if (objFile == NULL) + { + TraceLog(WARNING, "[%s] OBJ file could not be opened", fileName); + return vData; + } // First reading pass: Get numVertex, numNormals, numTexCoords, numTriangles // NOTE: vertex, texcoords and normals could be optimized (to be used indexed on faces definition) |
