diff options
author | bohu <bohu@google.com> | 2014-11-06 18:46:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-06 18:46:27 +0000 |
commit | 34704a5913e1e322eb5ece73543e9ce467a99bca (patch) | |
tree | 00ca88ff0eacf16faadfddfe522f5d976e8667a3 /emulator | |
parent | 72e9658d006ead8e59f3d08dcf79b516c7fb1fac (diff) | |
parent | 98fbf8a9d670f951b6ca1453e09288784078116f (diff) | |
download | sdk-34704a5913e1e322eb5ece73543e9ce467a99bca.zip sdk-34704a5913e1e322eb5ece73543e9ce467a99bca.tar.gz sdk-34704a5913e1e322eb5ece73543e9ce467a99bca.tar.bz2 |
Merge "Check and return correct error code"
Diffstat (limited to 'emulator')
-rw-r--r-- | emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp index 133e5e9..76542c1 100644 --- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp +++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp @@ -368,6 +368,7 @@ GL_APICALL void GL_APIENTRY glCompressedTexImage2D(GLenum target, GLint level, { GET_CTX(); SET_ERROR_IF(!GLESv2Validate::textureTargetEx(target),GL_INVALID_ENUM); + SET_ERROR_IF(level < 0 || imageSize < 0, GL_INVALID_VALUE); doCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, @@ -1740,10 +1741,10 @@ GL_APICALL void GL_APIENTRY glStencilOpSeparate(GLenum face, GLenum fail, GLenu GL_APICALL void GL_APIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels){ GET_CTX(); SET_ERROR_IF(!(GLESv2Validate::textureTargetEx(target) && - GLESv2Validate::pixelFrmt(ctx,internalformat) && GLESv2Validate::pixelFrmt(ctx,format)&& GLESv2Validate::pixelType(ctx,type)),GL_INVALID_ENUM); + SET_ERROR_IF(!GLESv2Validate::pixelFrmt(ctx,internalformat), GL_INVALID_VALUE); SET_ERROR_IF((format == GL_DEPTH_COMPONENT || internalformat == GL_DEPTH_COMPONENT) && (type != GL_UNSIGNED_SHORT && type != GL_UNSIGNED_INT), GL_INVALID_OPERATION); @@ -1814,8 +1815,9 @@ GL_APICALL void GL_APIENTRY glTexParameteriv(GLenum target, GLenum pname, const GL_APICALL void GL_APIENTRY glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels){ GET_CTX(); - SET_ERROR_IF(!(GLESv2Validate::textureTargetEx(target) && - GLESv2Validate::pixelFrmt(ctx,format)&& + SET_ERROR_IF(!(GLESv2Validate::textureTargetEx(target)), GL_INVALID_ENUM); + SET_ERROR_IF(width < 0 || height < 0, GL_INVALID_VALUE); + SET_ERROR_IF(!(GLESv2Validate::pixelFrmt(ctx,format)&& GLESv2Validate::pixelType(ctx,type)),GL_INVALID_ENUM); SET_ERROR_IF(!GLESv2Validate::pixelOp(format,type),GL_INVALID_OPERATION); if (type==GL_HALF_FLOAT_OES) |