diff options
author | Tina Zhang <tina.zhang@intel.com> | 2014-12-04 12:37:30 +0800 |
---|---|---|
committer | Tina Zhang <tina.zhang@intel.com> | 2014-12-11 09:44:40 +0800 |
commit | 8a44ff60e60a40d0da5f326c483c12079612f3cc (patch) | |
tree | 029add44d34732c11b15c4a36471ede4a9af3c8c /opengl/system/GLESv2_enc | |
parent | 5f23bd4a95e854a2a7f01ddbda17bb858873ad44 (diff) | |
download | android_device_generic_goldfish-8a44ff60e60a40d0da5f326c483c12079612f3cc.tar.gz android_device_generic_goldfish-8a44ff60e60a40d0da5f326c483c12079612f3cc.tar.bz2 android_device_generic_goldfish-8a44ff60e60a40d0da5f326c483c12079612f3cc.zip |
Add parameters validation to glShaderSource() API
According to GLES2.0 Spec., add parameters validataion to
glShaderSource() API.
Change-Id: I5b0e939fd9657ccbb40a13896c8fc74ef02fd085
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
Diffstat (limited to 'opengl/system/GLESv2_enc')
-rwxr-xr-x[-rw-r--r--] | opengl/system/GLESv2_enc/GL2Encoder.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/opengl/system/GLESv2_enc/GL2Encoder.cpp b/opengl/system/GLESv2_enc/GL2Encoder.cpp index 80a2cda..90aa61d 100644..100755 --- a/opengl/system/GLESv2_enc/GL2Encoder.cpp +++ b/opengl/system/GLESv2_enc/GL2Encoder.cpp @@ -656,7 +656,9 @@ void GL2Encoder::s_glShaderSource(void *self, GLuint shader, GLsizei count, cons { GL2Encoder* ctx = (GL2Encoder*)self; ShaderData* shaderData = ctx->m_shared->getShaderData(shader); - SET_ERROR_IF(!shaderData, GL_INVALID_VALUE); + SET_ERROR_IF(!ctx->m_shared->isObject(shader), GL_INVALID_VALUE); + SET_ERROR_IF(!shaderData, GL_INVALID_OPERATION); + SET_ERROR_IF((count<0), GL_INVALID_VALUE); int len = glUtilsCalcShaderSourceLen((char**)string, (GLint*)length, count); char *str = new char[len + 1]; |