Basically, the code is assuming that glMapBufferOES() will always return a valid pointer. The documentation for glMapBufferOES() states instead that null will be returned to signal an error. By ignoring the null case, the underlying OpenGL error results in a complete app crash when memcpy() tries to write data.
Following the OpenGL convention of ignoring commands if an error occurs, this code will ignore any errors that come out of OpenGL. I've dropped a few TODO comments where the code could be further improved. At least it shouldn't crash any longer.
This should resolve issue #19.
Basically, the code is assuming that glMapBufferOES() will always return a valid pointer. The documentation for glMapBufferOES() states instead that null will be returned to signal an error. By ignoring the null case, the underlying OpenGL error results in a complete app crash when memcpy() tries to write data.
Following the OpenGL convention of ignoring commands if an error occurs, this code will ignore any errors that come out of OpenGL. I've dropped a few TODO comments where the code could be further improved. At least it shouldn't crash any longer.