diff options
author | Kamil Kaminski <kamilkss@gmail.com> | 2011-07-28 16:07:24 -0500 |
---|---|---|
committer | Kamil Kaminski <kamilkss@gmail.com> | 2011-07-28 16:07:24 -0500 |
commit | 13ea210caea443bf7cd297c728b8af1561e2a325 (patch) | |
tree | ba55007d8c2be036caeab7c2052821ba2ae6cb80 | |
parent | b68c3521e04b04a0d74851e2224b19369ebf89c0 (diff) | |
download | glvbo-13ea210caea443bf7cd297c728b8af1561e2a325.tar.gz glvbo-13ea210caea443bf7cd297c728b8af1561e2a325.tar.bz2 glvbo-13ea210caea443bf7cd297c728b8af1561e2a325.zip |
check params for NULL in one of the functions
-rw-r--r-- | vbo.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -90,7 +90,7 @@ static int gltGenVBOInterleaved(GLuint *bufferobjects, float *vert_arr, return -1; } - /* build interleaved data structure, may not be cache friendly */ + /* build interleaved data structure, seems cache friendly */ int i; for (i = 0; i < slices_n; i++) { @@ -125,6 +125,9 @@ static int gltGenVBOInterleaved(GLuint *bufferobjects, float *vert_arr, static int gltDrawVBOInterleaved(GLuint *bufferobjects, size_t indices_n, GLenum mode) { + if (!bufferobjects || !indices_n) + return -1; + glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); |