summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorTina Zhang <tina.zhang@intel.com>2015-03-26 14:45:29 +0800
committerTina Zhang <tina.zhang@intel.com>2015-03-27 20:41:50 +0800
commitd94fa29f13b31b767b6431d974afac41b2e1b048 (patch)
treeed6d0985bc3d6310558062d02706e0b6209e14df /opengl
parentb16bbf75b85604e85c4d8f21b2fbe36d5d9ec6da (diff)
downloadandroid_device_generic_goldfish-d94fa29f13b31b767b6431d974afac41b2e1b048.tar.gz
android_device_generic_goldfish-d94fa29f13b31b767b6431d974afac41b2e1b048.tar.bz2
android_device_generic_goldfish-d94fa29f13b31b767b6431d974afac41b2e1b048.zip
Checking parameters for glCreateShader in guest
Currently, the guest part doesn't do enough to check each API's parameters. This may lead to conformance issues. Considering performance and conformance on multiple platform, it's better to add the parameter validation in guest part. Change-Id: Ic37c9bae5fba3c7e75a2095416fea41b8d1a949a Signed-off-by: Tina Zhang <tina.zhang@intel.com>
Diffstat (limited to 'opengl')
-rwxr-xr-xopengl/system/GLESv2_enc/GL2Encoder.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/opengl/system/GLESv2_enc/GL2Encoder.cpp b/opengl/system/GLESv2_enc/GL2Encoder.cpp
index 18c796e..dca504d 100755
--- a/opengl/system/GLESv2_enc/GL2Encoder.cpp
+++ b/opengl/system/GLESv2_enc/GL2Encoder.cpp
@@ -765,6 +765,8 @@ GLuint GL2Encoder::s_glCreateProgram(void * self)
GLuint GL2Encoder::s_glCreateShader(void *self, GLenum shaderType)
{
GL2Encoder *ctx = (GL2Encoder*)self;
+ RET_AND_SET_ERROR_IF(((shaderType != GL_VERTEX_SHADER) && (shaderType != GL_FRAGMENT_SHADER)),
+ GL_INVALID_ENUM, 0);
GLuint shader = ctx->m_glCreateShader_enc(self, shaderType);
if (shader != 0) {
if (!ctx->m_shared->addShaderData(shader)) {