Commit 345084ed by Nicolas Capens

Validate glOrtho() and glFrustum() parameters.

Change-Id: Ib041b2c412ea9db7a951e4eea24b7f27d8621cd0 Reviewed-on: https://swiftshader-review.googlesource.com/3780Reviewed-by: 's avatarNicolas Capens <capn@google.com> Tested-by: 's avatarNicolas Capens <capn@google.com>
parent d55a0953
...@@ -1650,6 +1650,11 @@ void Frustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat ...@@ -1650,6 +1650,11 @@ void Frustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat
{ {
TRACE("(GLfloat left = %f, GLfloat right = %f, GLfloat bottom = %f, GLfloat top = %f, GLfloat zNear = %f, GLfloat zFar = %f)", left, right, bottom, top, zNear, zFar); TRACE("(GLfloat left = %f, GLfloat right = %f, GLfloat bottom = %f, GLfloat top = %f, GLfloat zNear = %f, GLfloat zFar = %f)", left, right, bottom, top, zNear, zFar);
if(zNear <= 0.0f || zFar <= 0.0f || left == right || bottom == top || zNear == zFar)
{
return error(GL_INVALID_VALUE);
}
es1::Context *context = es1::getContext(); es1::Context *context = es1::getContext();
if(context) if(context)
...@@ -2778,6 +2783,11 @@ void Orthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zN ...@@ -2778,6 +2783,11 @@ void Orthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zN
{ {
TRACE("(GLfloat left = %f, GLfloat right = %f, GLfloat bottom = %f, GLfloat top = %f, GLfloat zNear = %f, GLfloat zFar = %f)", left, right, bottom, top, zNear, zFar); TRACE("(GLfloat left = %f, GLfloat right = %f, GLfloat bottom = %f, GLfloat top = %f, GLfloat zNear = %f, GLfloat zFar = %f)", left, right, bottom, top, zNear, zFar);
if(left == right || bottom == top || zNear == zFar)
{
return error(GL_INVALID_VALUE);
}
es1::Context *context = es1::getContext(); es1::Context *context = es1::getContext();
if(context) 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