jharwig / PPSSignatureView

iOS Signature Capture Demo
MIT License
1.04k stars 234 forks source link

Avoid crashing when OpenGL returns NULL from glMapBufferOES() #22

Open rmgrimm opened 8 years ago

rmgrimm commented 8 years ago

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.

jasconius commented 7 years ago

I suppose this project is dead, but this is a very valuable PR that makes this pod work just dandy even on new hardware/OS

a shame, since I think this is the best sig capture widget out there