Don't crash on a null pointer passed to glBufferData
TRAC #11528
* Initialise buffer to 0 if BufferData is called with data = NULL
(special case: if not resizing, just leave the old data in place).
* BufferSubData ignores calls with data = NULL
* Replace Buffer::data_t with GLubyte.
Author: Andrew Lewycky
Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch
git-svn-id: https://angleproject.googlecode.com/svn/trunk@59 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/libGLESv2.cpp b/src/libGLESv2/libGLESv2.cpp
index fcb8633..cb38dc3 100644
--- a/src/libGLESv2/libGLESv2.cpp
+++ b/src/libGLESv2/libGLESv2.cpp
@@ -482,6 +482,11 @@
return error(GL_INVALID_VALUE);
}
+ if (data == NULL)
+ {
+ return;
+ }
+
gl::Context *context = gl::getContext();
if (context)