Commit be381599 by Alexis Hetu Committed by Alexis Hétu

Added proper size/offset checks

glTexSubImage3D and glCopyTexSubImage3D were missing some validity checks for size and offset parameters. Change-Id: Iff1aa034318c1fc58f9bb433c61bd8623493604a Reviewed-on: https://swiftshader-review.googlesource.com/3602Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 895a1e72
......@@ -642,7 +642,7 @@ GL_APICALL void GL_APIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xo
return error(GL_INVALID_VALUE);
}
if((width < 0) || (height < 0) || (depth < 0))
if((width < 0) || (height < 0) || (depth < 0) || (xoffset < 0) || (yoffset < 0) || (zoffset < 0))
{
return error(GL_INVALID_VALUE);
}
......@@ -680,6 +680,11 @@ GL_APICALL void GL_APIENTRY glCopyTexSubImage3D(GLenum target, GLint level, GLin
return error(GL_INVALID_VALUE);
}
if((width < 0) || (height < 0) || (xoffset < 0) || (yoffset < 0) || (zoffset < 0))
{
return error(GL_INVALID_VALUE);
}
es2::Context *context = es2::getContext();
if(context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment